Commit Graph

2 Commits

Author SHA1 Message Date
Khoa (Revenovich) Tran Gia
1c852f26f8 fix: prevent WebSocket AssertionError when StaticFiles catch-all intercepts WS
In Starlette 0.52+, Mount('/') returns Match.FULL for every WebSocket
scope. If APIWebSocketRoute('/ws') is somehow not matched first, the
StaticFiles mount catches the connection and crashes with:
  assert scope["type"] == "http"  # AssertionError

Two-layer fix:
- _SPAStaticFiles.__call__: gracefully close non-HTTP connections with
  WebSocketClose() and log a warning with the actual path/type so the
  routing issue can be diagnosed.
- app.add_websocket_route('/ws', websocket_endpoint): belt-and-suspenders
  registration using Starlette's base WebSocketRoute (simpler than
  FastAPI's APIWebSocketRoute) right before the StaticFiles mount. If
  include_router's APIWebSocketRoute doesn't match, this fallback will.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 10:56:41 +07:00
Khoa (Revenovich) Tran Gia
1ed3c9ec4b Initial commit — ComfyUI Discord bot + web UI
Full source for the-third-rev: Discord bot (discord.py), FastAPI web UI
(React/TS/Vite/Tailwind), ComfyUI integration, generation history DB,
preset manager, workflow inspector, and all supporting modules.

Excluded from tracking: .env, invite_tokens.json, *.db (SQLite),
current-workflow-changes.json, user_settings/, presets/, logs/,
web-static/ (build output), frontend/node_modules/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 09:55:48 +07:00