Read handshake status from public API instead of parsing library error strings
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 74/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- networking
Direzione di ricerca
Read handshakeStatus in src/websocket/utils.ts and trace the SSE path through SseConnection.createErrorEvent in src/websocket/sseConnection.ts; first run test/unit/websocket/utils.test.ts to understand the existing coverage. Check how the public event data reaches handshakeStatus, then verify that unrecoverable-HTTP handling and the SSE 404 fallback still work without relying on error message text.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background
handshakeStatus (src/websocket/utils.ts) recovers the HTTP status of a failed
WebSocket/SSE handshake by parsing the error message text from two libraries:
ws—Unexpected server response: <code>eventsource—Non-200 status code (<code>)
Neither string is a public contract; both are plain template literals
(ws/lib/websocket.js and eventsource/src/EventSource.ts). If either reword on
a version bump, handshakeStatus returns undefined, every unrecoverable status
becomes a retry-forever connection_error, and CoderApi.is404Error stops
falling back to SSE.
A real-library test (test/unit/websocket/utils.test.ts) now guards against a
silent reword by failing in CI, but parsing internal strings is still fragile.
Proposal
Read the status from the libraries' public event APIs instead of the message:
- SSE:
eventsourceputs the status onErrorEvent.code(documented public
API).SseConnection.createErrorEvent(src/websocket/sseConnection.ts)
currently reads onlymessageanderrorand dropscode; surface it. - WebSocket:
wsexposes the same on itsunexpected-responseevent, which
also suppresses the string path once handled.
Once the status comes from the events, handshakeStatus's string parsing can be
narrowed or removed.
Acceptance
- Handshake status is derived from
ErrorEvent.code/ thews
unexpected-responseevent, not the error message text. - Unrecoverable-HTTP handling and the SSE 404 fallback keep working.
Filed by Coder Agents on behalf of @aqandrew, as a follow-up to PR #1100.
- Lingua principale
- TypeScript
- Stelle
- 131
- Fork
- 48
- Merge medio
- 4g 15h
- PR unite (30g)
- 17
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/vscode-coder
-
coder/vscode-coder#1125 · 1 commento · 1 assegnatario ·
-
tech-debt
coder/vscode-coder#1119 · 1 commento · 1 assegnatario ·
-
coder/vscode-coder#1113 · 3 commenti · 1 assegnatario ·
-
Flush the connection log buffer after N failed reconnect attempts against an unreachable server Apertaenhancement tech-debt
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
coder/vscode-coder#1112 · 1 commento ·
-
bug upstream
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
coder/vscode-coder#1087 · 1 commento ·
Tutte le issue di coder/vscode-coder
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
motiondivision/motion#3849 ·
-
Add: S Play Event HD Apertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
LiteLLM proxy response_cost (x-litellm-response-cost) is never applied to ChatModelOutput.cost Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
i-am-bee/beeai-framework#1697 · 1 reazione ·
-
Support bun dedupe Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
antfu/node-modules-inspector#214 ·