Skip to content

Add inbound sync API#138

Draft
marcus-pousette wants to merge 3 commits into
cybersemics:sync/app-facing-controllerfrom
marcus-pousette:sync/scoped-live-controller
Draft

Add inbound sync API#138
marcus-pousette wants to merge 3 commits into
cybersemics:sync/app-facing-controllerfrom
marcus-pousette:sync/scoped-live-controller

Conversation

@marcus-pousette
Copy link
Copy Markdown
Collaborator

@marcus-pousette marcus-pousette commented May 5, 2026

Summary

Adds the inbound companion to #137: createInboundSync({ localPeer }) owns one-shot reconciliation and live subscriptions by filter across current and future peer transports.

The playground now declares desired inbound scopes (all or children(parent)) and uses the same inbound helper for manual scoped sync and live subscriptions, instead of maintaining separate per-peer subscription maps and manual peer success/error loops.

Before

const sub = peer.subscribe(transport, { children: { parent } }, opts)
await sub.ready
sub.done.catch(handleLiveError)
sub.stop()

for (const peerId of targets) {
  await peer.syncOnce(transport, filter, opts)
}

After

const inbound = createInboundSync({ localPeer: peer })
inbound.addPeer(peerId, transport)

const children = inbound.scope({ children: { parent } })
await children.syncOnce()
children.startLive()
children.close()

Stacked on #137.

@marcus-pousette marcus-pousette force-pushed the sync/scoped-live-controller branch from 664668c to 7e98f4b Compare May 5, 2026 08:48
@marcus-pousette marcus-pousette changed the title Add scoped live sync controller Add inbound sync API May 5, 2026
@marcus-pousette marcus-pousette force-pushed the sync/scoped-live-controller branch from 7e98f4b to 7249913 Compare May 5, 2026 09:00
@marcus-pousette marcus-pousette force-pushed the sync/app-facing-controller branch from d7c5bb6 to edcaec2 Compare May 5, 2026 12:07
@marcus-pousette marcus-pousette force-pushed the sync/scoped-live-controller branch from 7249913 to 7709dfc Compare May 5, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant