CircuitsGroupSyncOptions
Defined in: packages/client/src/circuits/group-sync.ts:113
Properties
Section titled “Properties”authHeaders?
Section titled “authHeaders?”
optionalauthHeaders?: () =>Record<string,string> |Promise<Record<string,string>>
Defined in: packages/client/src/circuits/group-sync.ts:120
The caller’s own auth headers, resolved per request — the same adapter the write path uses.
Returns
Section titled “Returns”Record<string, string> | Promise<Record<string, string>>
bootCollector?
Section titled “bootCollector?”
optionalbootCollector?:BootStampCollector
Defined in: packages/client/src/circuits/group-sync.ts:130
Boot observability (ADR-0034). Only the BOOT starts (eager + promoted) open an accumulator, so an on-demand lazy activation never enters a finalized report.
controlPlaneUrl
Section titled “controlPlaneUrl”controlPlaneUrl:
string
Defined in: packages/client/src/circuits/group-sync.ts:116
Base URL of the control plane — where subscribe, re-mint and the barrier live.
fetch?
Section titled “fetch?”
optionalfetch?: typeoffetch
Defined in: packages/client/src/circuits/group-sync.ts:185
optionallive?:boolean
Defined in: packages/client/src/circuits/group-sync.ts:175
metadataSchema
Section titled “metadataSchema”metadataSchema:
string
Defined in: packages/client/src/circuits/group-sync.ts:121
onAuthError?
Section titled “onAuthError?”
optionalonAuthError?: (error) =>void
Defined in: packages/client/src/circuits/group-sync.ts:154
The subject’s own credential was refused by the control plane (401/403), and subscribe is still retrying (ADR-0013). The app prompts for re-login; nothing here needs restarting, because the auth adapter is consulted fresh on every attempt.
Distinct from onSyncError, which reports a fault the subject cannot act on.
Parameters
Section titled “Parameters”ControlPlaneError
Returns
Section titled “Returns”void
onGroupReady?
Section titled “onGroupReady?”
optionalonGroupReady?: (groupKey) =>void
Defined in: packages/client/src/circuits/group-sync.ts:133
Parameters
Section titled “Parameters”groupKey
Section titled “groupKey”string
Returns
Section titled “Returns”void
onInitialSync?
Section titled “onInitialSync?”
optionalonInitialSync?: () =>void
Defined in: packages/client/src/circuits/group-sync.ts:132
Fired the first time every eager/promoted group has caught up.
Returns
Section titled “Returns”void
onLazyActivated?
Section titled “onLazyActivated?”
optionalonLazyActivated?: (groupKey) =>void
Defined in: packages/client/src/circuits/group-sync.ts:137
Called when a durable lazy group is activated on demand, so the next boot can promote it.
Parameters
Section titled “Parameters”groupKey
Section titled “groupKey”string
Returns
Section titled “Returns”void
onRefused?
Section titled “onRefused?”
optionalonRefused?: (refused) =>void
Defined in: packages/client/src/circuits/group-sync.ts:146
Called with the scopes the control plane refused or later revoked.
Fired AFTER the refused scopes’ local rows have been cleared, never before. Losing entitlement means losing the subscription, not keeping the rows (ADR-0055 decision 6), and an app that reacts to this — re-rendering, prompting, navigating away — must not be handed a store that still shows what the subject may no longer read.
Parameters
Section titled “Parameters”refused
Section titled “refused”readonly RefusedStream[]
Returns
Section titled “Returns”void
onStreamError?
Section titled “onStreamError?”
optionalonStreamError?: (error) =>void
Defined in: packages/client/src/circuits/group-sync.ts:174
A live stream ended or could not be opened — a 403 that survived a re-mint, a 404/410 on an
evicted stream, Stream-Closed, a lost connection — and the group is re-subscribing with
backoff.
Recoverable, and it clears on the next delivered batch. Distinct from onSubscribeError (the
CONTROL PLANE could not be reached, so there is nothing to read from yet) and from onSyncError
(a COMMIT failed, which is sticky by design because reads can keep succeeding while applies keep
failing).
Parameters
Section titled “Parameters”Error
Returns
Section titled “Returns”void
onSubscribeError?
Section titled “onSubscribeError?”
optionalonSubscribeError?: (error) =>void
Defined in: packages/client/src/circuits/group-sync.ts:163
Subscribe failed for a reason the subject cannot act on — the control plane is down, degraded, or unreachable — and is still retrying.
Separate from onSyncError because the two recover differently: a failed subscribe clears the
moment a batch is delivered, while a commit failure is sticky by design (ADR-0009 decision 5) —
reads can keep succeeding while applies keep failing.
Parameters
Section titled “Parameters”Error
Returns
Section titled “Returns”void
onSyncActivity?
Section titled “onSyncActivity?”
optionalonSyncActivity?: () =>void
Defined in: packages/client/src/circuits/group-sync.ts:135
Returns
Section titled “Returns”void
onSyncError?
Section titled “onSyncError?”
optionalonSyncError?: (error) =>void
Defined in: packages/client/src/circuits/group-sync.ts:134
Parameters
Section titled “Parameters”Error
Returns
Section titled “Returns”void
promotedGroups?
Section titled “promotedGroups?”
optionalpromotedGroups?:ReadonlySet<string>
Defined in: packages/client/src/circuits/group-sync.ts:125
Lazy groups whose activation persisted from a previous boot (ADR-0021), started eagerly here.
registry
Section titled “registry”registry:
SyncTableRegistry
Defined in: packages/client/src/circuits/group-sync.ts:114
signal?
Section titled “signal?”
optionalsignal?:AbortSignal
Defined in: packages/client/src/circuits/group-sync.ts:184
Tears the whole read path down from OUTSIDE, including mid-boot.
unsubscribe() cannot cover that window: it lives on the handle this function returns, and a boot
whose control plane is unreachable has not returned one yet. A client stopped in that window would
otherwise sit on a TCP connect with nothing able to cancel it — which is precisely when a stop is
most likely, because the network being down is why the boot is still running.
streamBaseUrl
Section titled “streamBaseUrl”streamBaseUrl:
string
Defined in: packages/client/src/circuits/group-sync.ts:118
Base URL the edge serves streams from.