fix(extension): harden websocket reconnect lifecycle - #82
Merged
Conversation
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 and conflicts resolved. All credit to @NianJiuZst.
Conflict resolution notes
Rebased onto
mainafter #17 landed; the two redundant commits (Biome formatting, port test fix) were dropped automatically since their content already reached main via #17. The remaining conflict inapps/extension/src/lib/connection-controller.tswas resolved by composing both changes instead of picking a side:ConnectionLifecycleHooks(beforeDisconnect/onDisconnected) and the serializedrecoverFromDisconnect()path (explicit disconnect to cancel WSTransport's internal reconnect timer before session teardown, then reconnect).AbortController(this supersedes fix(runtime): clean up sessions on disconnect #17'shandshakeInFlightboolean, which was removed rather than duplicated),AbortSignalplumbed intoperformHandshake, and the 1s handshake retry timer.recoverFromDisconnect()bails out if another path already reconnected while it yielded (state no longerdisconnected).Verification
pnpm lint(biome check + stylelint): cleantsc --noEmit: cleanvitest run: 571 passed / 48 failed — all 48 are the pre-existingReact.act is not a functionfailures in.tsxpopup/overlay tests; identical failure set onorigin/main(48 there as well), so no regression. The 4 new tests from this PR pass.