Skip to content

fix(mobile): keep a permanent ws error sink in streamSession - #313

Merged
yaojin3616 merged 1 commit into
dataelement:mainfrom
HuangLeijiana:pr/fix-mobile-streamsession-error-sink
Sep 5, 2026
Merged

fix(mobile): keep a permanent ws error sink in streamSession#313
yaojin3616 merged 1 commit into
dataelement:mainfrom
HuangLeijiana:pr/fix-mobile-streamsession-error-sink

Conversation

@HuangLeijiana

Copy link
Copy Markdown
Contributor

Closing a still-CONNECTING mux WebSocket from finish() makes ws raise 'error' asynchronously, after cleanup() has removed the real listener. consumeMux guards that self-inflicted error with a permanent empty sink and documents it as a process crash without one; streamSession unwinds with the identical close pattern but had no sink, so aborting a session stream (SSE disconnect, bridge stop) while the gateway handshake is in flight could take the whole Electron main process down.

Add the same permanent sink with a lockstep comment, plus an integration test that holds the mux upgrade open and aborts the SSE request: without the sink the run dies on an unhandled 'error' at the close site.

Closing a still-CONNECTING mux WebSocket from finish() makes ws raise
'error' asynchronously, after cleanup() has removed the real listener.
consumeMux guards that self-inflicted error with a permanent empty sink
and documents it as a process crash without one; streamSession unwinds
with the identical close pattern but had no sink, so aborting a session
stream (SSE disconnect, bridge stop) while the gateway handshake is in
flight could take the whole Electron main process down.

Add the same permanent sink with a lockstep comment, plus an integration
test that holds the mux upgrade open and aborts the SSE request: without
the sink the run dies on an unhandled 'error' at the close site.
@yaojin3616
yaojin3616 merged commit e878dba into dataelement:main Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants