Skip to content

Documentation / @etherfold/browser / PublicationState

Type Alias: PublicationState ​

PublicationState = { status: "reading"; } | { at: number; from: string; snapshot: string; status: "found"; } | { at: number; budgetSeconds?: number; estimateSeconds?: number; from: string; left: number; reason: SnapshotSwitchReason; snapshot: string; status: "switched"; } | { from?: string; reason: PublicationRefusalReason; status: "refused"; streams?: readonly string[]; }

Defined in: packages/browser/src/publication.ts:182

WHAT THE PUBLICATION INDEX GAVE THIS TAB, as SyncingState.publication reports it.

It reports the LOOKUP, and nothing about the install: whether the snapshot then installed is what openAndBootstrap answers the app's own createState, and what the seed install did is SyncingState.streamSeed, as it always was.

Union Members ​

Type Literal ​

{ status: "reading"; }

The index is being read, or read and waiting for the generation it is for to be built.


Type Literal ​

{ at: number; from: string; snapshot: string; status: "found"; }

at ​

readonly at: number

The block the snapshot's rows are as of.

from ​

readonly from: string

Which index location named it.

snapshot ​

readonly snapshot: string

Where the snapshot body is.

status ​

readonly status: "found"

The index names a snapshot for this generation, and createState was handed it.


Type Literal ​

{ at: number; budgetSeconds?: number; estimateSeconds?: number; from: string; left: number; reason: SnapshotSwitchReason; snapshot: string; status: "switched"; }

at ​

readonly at: number

The block the snapshot's rows are as of, which is where the tab now resumes.

budgetSeconds? ​

readonly optional budgetSeconds?: number

For over-budget: the budget it exceeded, in seconds (catchUpWithinSeconds).

estimateSeconds? ​

readonly optional estimateSeconds?: number

For over-budget: how long the rest of the catch-up was estimated to take, in seconds.

from ​

readonly from: string

Which index location named the snapshot.

left ​

readonly left: number

How far the local state had got when it was abandoned.

reason ​

readonly reason: SnapshotSwitchReason

snapshot ​

readonly snapshot: string

Where the snapshot body is.

status ​

readonly status: "switched"

The tab HELD LOCAL STATE, started catching up from its own cursor, and abandoned that for the snapshot the index names: the local state was wiped and the snapshot installed through createState (handed replaceLocal), and the tab indexes forward from the snapshot's cursor (ADR-0096).


Type Literal ​

{ from?: string; reason: PublicationRefusalReason; status: "refused"; streams?: readonly string[]; }

from? ​

readonly optional from?: string

Which index location was read, where one was.

reason ​

readonly reason: PublicationRefusalReason

status ​

readonly status: "refused"

No published snapshot for this generation. The tab starts ANYWAY, indexing from the chain.

streams? ​

readonly optional streams?: readonly string[]

For stream-mismatch: the stream digests the entries for this processor ARE for, so an app can say "published for other contracts or finality" by name.