Optionaloptions: { rejectBranchingSessions?: boolean }OptionalrejectBranchingSessions?: booleanWhen true, a sessionId lookup
that resolves to a branched history (more than one leaf) throws
FAILED_PRECONDITION instead of returning the latest leaf. Defaults to
false; opt in (e.g. in dev) to surface accidental branching early.
Loads a snapshot either by its snapshotId or by sessionId.
See GetSnapshotOptions for the lookup semantics (exactly one of
snapshotId / sessionId; sessionId resolves to the session's latest
leaf snapshot, optionally rejecting branching histories).
Optionaloptions: SessionStoreOptionsAtomically reads the current snapshot (if snapshotId is provided),
passes it to mutator, and persists the result.
snapshotId is provided the store reads the existing snapshot
and passes it to the mutator. The mutator can inspect the current
state (e.g. to check for concurrent status changes) and return the
updated snapshot to save, or null to skip the write.snapshotId is undefined the store passes undefined to
the mutator (signaling a new snapshot). The store assigns a new
identifier.Implementations should ensure the read→mutate→write cycle is atomic to prevent race conditions (e.g. a "done" write overwriting a concurrent "aborted" status).
The mutator can:
null to silently skip the write.Optionaloptions: SessionStoreOptionsThe snapshotId that was used, or null when the mutator
returned null.
In-memory implementation of persistent Session Store.