Skip to content

CircuitsGroupSyncOptions

Defined in: packages/client/src/circuits/group-sync.ts:113

optional authHeaders?: () => 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.

Record<string, string> | Promise<Record<string, string>>


optional bootCollector?: 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: 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.


optional fetch?: typeof fetch

Defined in: packages/client/src/circuits/group-sync.ts:185


optional live?: boolean

Defined in: packages/client/src/circuits/group-sync.ts:175


metadataSchema: string

Defined in: packages/client/src/circuits/group-sync.ts:121


optional onAuthError?: (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.

ControlPlaneError

void


optional onGroupReady?: (groupKey) => void

Defined in: packages/client/src/circuits/group-sync.ts:133

string

void


optional onInitialSync?: () => void

Defined in: packages/client/src/circuits/group-sync.ts:132

Fired the first time every eager/promoted group has caught up.

void


optional onLazyActivated?: (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.

string

void


optional onRefused?: (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.

readonly RefusedStream[]

void


optional onStreamError?: (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).

Error

void


optional onSubscribeError?: (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.

Error

void


optional onSyncActivity?: () => void

Defined in: packages/client/src/circuits/group-sync.ts:135

void


optional onSyncError?: (error) => void

Defined in: packages/client/src/circuits/group-sync.ts:134

Error

void


optional promotedGroups?: 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: SyncTableRegistry

Defined in: packages/client/src/circuits/group-sync.ts:114


optional signal?: 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: string

Defined in: packages/client/src/circuits/group-sync.ts:118

Base URL the edge serves streams from.