feat(sync): add a reliable inbound sync controller#138
Open
marcus-pousette wants to merge 1 commit into
Open
Conversation
664668c to
7e98f4b
Compare
7e98f4b to
7249913
Compare
d7c5bb6 to
edcaec2
Compare
7709dfc to
2f4ba43
Compare
This was referenced May 5, 2026
2f4ba43 to
3470733
Compare
854fd22 to
1c4c0ff
Compare
a6ed58e to
91ca885
Compare
1c4c0ff to
a7f1677
Compare
91ca885 to
e3d69f3
Compare
a7f1677 to
b187784
Compare
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.
What
Add
createInboundSync, a small app-facing controller for reconciling and subscribing the same filters across registered peer transports.This is the controller-only layer of the former #138. Protocol cancellation lives in #204; playground adoption is a separate follow-up.
Failure contract
syncOnceresolves only when every requested peer/filter target succeeds. It lets all requested targets finish, then throwsInboundSyncAggregateErrorwhen any failed. Each entry retains the exactpeerId,filter, and original error, including unknown requested peers.A timeout aborts the underlying protocol session rather than merely stopping the caller's wait.
Observer callbacks are notifications: exceptions from
onErrororonStatuscannot replace the aggregate result or corrupt controller state. Repeating the same declarative filter set restarts subscriptions that previously failed.Fast paths left
subscribereuses the existing filter objects and only starts missing peer subscriptions.SyncPeer.syncOnce; the controller adds only target iteration, status, timeout, and aggregation.Verification
@treecrdt/syncstack: 31/31 tests.Dependency
Stacked on #204. Review only this five-file controller diff.