Add inbound sync API#138
Draft
marcus-pousette wants to merge 20 commits into
Draft
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
…ync/scoped-live-controller
… sync/scoped-live-controller
… sync/scoped-live-controller
… sync/scoped-live-controller
… sync/scoped-live-controller
… sync/scoped-live-controller
… sync/scoped-live-controller
… sync/scoped-live-controller # Conflicts: # examples/playground/src/playground/hooks/usePlaygroundSync.ts
… sync/scoped-live-controller
… sync/scoped-live-controller # Conflicts: # examples/playground/src/playground/hooks/usePlaygroundSync.ts
… sync/scoped-live-controller # Conflicts: # examples/playground/src/playground/hooks/usePlaygroundSync.ts
… sync/scoped-live-controller
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.
Summary
Adds the inbound companion to #137:
createInboundSync({ localPeer })manages one-shot reconciliation and live subscriptions across current and future peer transports.Scope of this PR: replace app-owned inbound sync fanout and live subscription bookkeeping. It does not replace transport discovery, websocket status UI, auth setup, or outbound local-op upload. Outbound upload is handled by #137.
EM Integration Before
Source reference: the current
Antonov548/emfork has its TreeCRDT websocket sync entrypoint intreecrdtWebSocketSync.ts, with remote materialization wired back into Redux frominitialize.ts.The current fork uses one high-level websocket handle. If that integration needs scoped or multi-peer inbound sync, the sync module would otherwise have to grow peer transport maps, subscription maps, in-flight guards, and manual sync fanout like this:
That makes the app sync module responsible for subscription lifecycle, filter diffing, ready/done errors, peer cleanup, and per-peer
syncOnceloops.EM Integration After
With #138, an em-style sync module can keep the same high-level decisions in app code while moving the inbound mechanics into
createInboundSync.The app still chooses peers and filters. The helper owns the repeated transport fanout, subscription maps, in-flight guards, cleanup, and error reporting surface.
Stacked on #137.