fix(extension): harden websocket reconnect lifecycle - #88
Closed
BB-fat wants to merge 2 commits into
Closed
Conversation
…covery Reconnection after a failed/dropped handshake is owned solely by recoverFromDisconnect(); the PR's 1s retry timer is dropped (redundant and double-connects), the generation/abort handshake binding is kept. Tests updated to assert the merged semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Supersedes #19 — rebased onto current main with conflicts resolved. All credit to @NianJiuZst for the original design and implementation.
What this is
#19 hardened the websocket reconnect lifecycle: generation-bound handshakes (a stale handshake result can never bind to a new connection), abortable in-flight handshakes, and retry-on-failure. After #17 (disconnect cleanup) merged, the PR conflicted with main; this branch resolves that.
Conflict resolution notes (vs original #19)
ConnectionLifecycleHooks+recoverFromDisconnect()and fix(extension): harden websocket reconnect lifecycle #19's generation/abort machinery (connectionGeneration,handshakeAbort,cancelHandshake). On transport disconnect we now cancel the in-flight handshake and run the recovery teardown+reconnect.scheduleHandshakeRetrytimer: with fix(runtime): clean up sessions on disconnect #17 in main, reconnection is owned byrecoverFromDisconnect()— keeping both would double-connect. The handshake-failure path disconnects the socket, which drives recovery (teardown + reconnect), preserving fix(extension): harden websocket reconnect lifecycle #19's "retry after failed handshake" intent.Verification
tsc --noEmit,pnpm lint(biome + stylelint): clean.connection-controller/handshake/ws-transportvitest: 36/36 pass.