fix: accept WebSocket before validation to prevent opaque 403 errors #160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
accept(), causing Starlette to return opaque HTTP 403 errors with no useful information to the clientwebsocket.accept()before all validation checks so errors are sent as JSON messages before clean close with 4xxx codeshasSpecto prevent opening the expand modal when no spec existsChanges
Server (5 files):
expand_project.py- Accept before validation + spec checkspec_creation.py- Accept before validation, fixvalidate_project_nameusageassistant_chat.py- Accept before validation, fixvalidate_project_nameusageterminal.py- Accept before all validation checkswebsocket.py- Accept before validation,ConnectionManager.connect()no longer double-acceptsClient (6 files):
useWebSocket.ts/useExpandChat.ts/useSpecChat.ts- Skip reconnection on 4xxx close codesApp.tsx- Gate expand shortcut (E key) and modal render onhasSpecKanbanBoard.tsx- Gate expand button onhasSpecKeyboardShortcutsHelp.tsx- Update E key context textTest plan
hasSpecis falsehasSpecis false🤖 Generated with Claude Code