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?: readonlystring[]; }
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 ​
readonlyat:number
The block the snapshot's rows are as of.
from ​
readonlyfrom:string
Which index location named it.
snapshot ​
readonlysnapshot:string
Where the snapshot body is.
status ​
readonlystatus:"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 ​
readonlyat:number
The block the snapshot's rows are as of, which is where the tab now resumes.
budgetSeconds? ​
readonlyoptionalbudgetSeconds?:number
For over-budget: the budget it exceeded, in seconds (catchUpWithinSeconds).
estimateSeconds? ​
readonlyoptionalestimateSeconds?:number
For over-budget: how long the rest of the catch-up was estimated to take, in seconds.
from ​
readonlyfrom:string
Which index location named the snapshot.
left ​
readonlyleft:number
How far the local state had got when it was abandoned.
reason ​
readonlyreason:SnapshotSwitchReason
snapshot ​
readonlysnapshot:string
Where the snapshot body is.
status ​
readonlystatus:"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? ​
readonlyoptionalfrom?:string
Which index location was read, where one was.
reason ​
readonlyreason:PublicationRefusalReason
status ​
readonlystatus:"refused"
No published snapshot for this generation. The tab starts ANYWAY, indexing from the chain.
streams? ​
readonlyoptionalstreams?: readonlystring[]
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.