Skip to content

refactor(playground): adopt the sync controllers#205

Open
marcus-pousette wants to merge 1 commit into
stack/inbound-sync-controllerfrom
feat/playground-inbound-sync
Open

refactor(playground): adopt the sync controllers#205
marcus-pousette wants to merge 1 commit into
stack/inbound-sync-controllerfrom
feat/playground-inbound-sync

Conversation

@marcus-pousette

@marcus-pousette marcus-pousette commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

What this does

Replaces the playground's bespoke outbound upload loop and inbound subscription bookkeeping with the controllers from #137 and #138.

  • Queue committed local operations through the outbound controller.
  • Register the remote WebSocket as the exact-operation upload target.
  • Keep local mesh transports attached directly to SyncPeer.
  • Express desired child/all subscriptions declaratively through the inbound controller.
  • Route manual, scoped, and automatic pulls through the all-target completion contract.
  • Handle aggregate failures per peer.
  • Keep capability-revoked peers connected while removing genuinely dead transports.

Why

The playground previously duplicated upload queueing, timeout handling, peer selection, and per-peer subscription lifecycle beside SyncPeer. After this change, the UI owns only application policy and connection state; retry preservation, target replacement, subscriptions, cancellation, and aggregate completion live in the tested controllers.

Debloat and fast paths

This is a net deletion: 9 files, +358/-520 (net -162).

  • Exact committed operations push directly; normal edits do not rescan the full log.
  • Local-tab transports do not enter the remote upload loop.
  • Unchanged transports and subscriptions are reused.
  • Error classification is dependency-free and runs only after a failure.
  • No polling loop or new transport abstraction is added.

Verification

This UI-only layer is stacked on #138 through the stack/inbound-sync-controller mirror.

@marcus-pousette marcus-pousette added enhancement New feature or request area:sync Sync protocol, reconciliation, transport, discovery, and sync servers area:web Browser, WASM, OPFS, workers, and playground runtime labels Jul 12, 2026
@marcus-pousette marcus-pousette force-pushed the stack/inbound-sync-controller branch from 1c4c0ff to a7f1677 Compare July 12, 2026 14:09
@marcus-pousette marcus-pousette force-pushed the feat/playground-inbound-sync branch from 75885ca to 627c833 Compare July 12, 2026 14:09
@marcus-pousette marcus-pousette force-pushed the stack/inbound-sync-controller branch from a7f1677 to b187784 Compare July 12, 2026 15:23
@marcus-pousette marcus-pousette force-pushed the feat/playground-inbound-sync branch from 627c833 to c1b0eb1 Compare July 12, 2026 15:44
@marcus-pousette marcus-pousette changed the title refactor(playground): adopt the inbound sync controller refactor(playground): adopt the sync controllers Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:sync Sync protocol, reconciliation, transport, discovery, and sync servers area:web Browser, WASM, OPFS, workers, and playground runtime enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant