Repository navigation
fix(sync): scope transport failures and session routing - #181
Merged
Merged
Conversation
This was referenced Jul 12, 2026
marcus-pousette
force-pushed
the
fix/transport-terminal-errors
branch
from
July 13, 2026 15:46
d516319 to
62d828f
Compare
Co-Authored-By: Codex GPT-5 (unknown context) <noreply@openai.com>
marcus-pousette
force-pushed
the
fix/transport-terminal-errors
branch
from
August 18, 2026 17:22
62d828f to
7835c30
Compare
Co-Authored-By: Codex GPT-5 (unknown context) <noreply@openai.com>
Antonov548
approved these changes
Aug 20, 2026
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.
Problem
When a client reconnects, the old and replacement connections may briefly overlap and reuse the same protocol IDs.
SyncPeerpreviously keyed sessions and subscriptions by protocol ID alone.A late response or cleanup from the old connection could therefore advance or remove state belonging to the replacement connection. Meanwhile, operations waiting on the dead connection could remain unresolved indefinitely.
Protocol IDs are connection-local, so protocol state and closure must be scoped to the transport that owns them.
This PR makes reconnecting safe when the caller supplies a fresh transport; it does not implement automatic reconnection.
Before / after
Before, transports only carried messages and responder state was addressed by ID alone:
After, every transport represents one connection lifecycle and exposes synchronous, idempotent closure:
The high-level custom-transport factory now owns cleanup:
This is a source-breaking change for custom transports and test doubles. There is no wire-format change.
Changes
close()and a read-onlycloseSignal; reject transport-object reuse after detach or closure.closeSignaldescribes permanent connection closure. It does not replaceAbortSignalfor canceling one sync attempt.Validation