Documentation / @etherfold/browser / PublicationSnapshot
Type Alias: PublicationSnapshot ​
PublicationSnapshot =
object
Defined in: packages/browser/src/publication.ts:88
THE STATE SNAPSHOT THE INDEX NAMES FOR THIS GENERATION, as createState is handed it: exactly the two arguments the existing bootstrap takes.
createState: async (context, {signal}, bundle, published) => {
const backend = await createBrowserStateStore(entities, {databaseName: `app-${context.stream}`});
const {store} = published
? await openAndBootstrap(backend, published.locations, {
processor: published.processor,
replaceLocal: published.replaceLocal,
finalityDepth: 12,
})
: {store: await openSnapshotAware(backend)};
return openForWriting(store, {signal});
},Properties ​
entry ​
readonlyentry:PublishedStateSnapshot
Defined in: packages/browser/src/publication.ts:98
The index entry, verbatim, for an app that renders where its state came from.
index ​
readonlyindex:string
Defined in: packages/browser/src/publication.ts:100
Which index location named it.
locations ​
readonlylocations: readonlystring[]
Defined in: packages/browser/src/publication.ts:90
Where the body is, resolved against the index that named it: openAndBootstrap's locations.
processor ​
readonlyprocessor:string
Defined in: packages/browser/src/publication.ts:96
The processor the entry was computed by, which IS this generation's identity: openAndBootstrap's processor. Handed back rather than left for the app to restate, so the equality the bootstrap checks is the one the index was read by.
replaceLocal ​
readonlyreplaceLocal:boolean
Defined in: packages/browser/src/publication.ts:113
WHETHER THE LOCAL STATE IS TO BE REPLACED: openAndBootstrap's replaceLocal, so forward it.
false when the generation is built at init: a tab that already holds local state keeps it and catches up from its own cursor. true when the hook builds the generation AGAIN mid-run because the catch-up was abandoned (ADR-0096: the node refused it as an archive refusal, or it was estimated to take longer than catchUpWithinSeconds), so the snapshot is installed over the local state, which the install wipes first. A createState that does not forward it keeps its local state, and the hook then reports the refusal it would have reported anyway.