IVersionMarkResolver Interface
Runtime-owned resolver for app-stored version mark locators.
To use, import via @fluidframework/container-runtime/legacy.
For more information about our API support guarantees, see here.
Signature
export interface IVersionMarkResolver
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| onBatchSequenced(listener) | Beta | () => void | Subscribes to inbound batch sequencing: fires (batchId, sequenceNumber) per batch so any connected client can promote a matching pending mark. Returns an unsubscribe function. |
| resolve(batchId, sequenceNumberLowerBound) | Beta | Promise<ResolveResult> | Resolves a pending mark's batchId to a global sequence number (sequenceNumberLowerBound is the exclusive lower bound for a history read). A resolved sequence number feeds the loader's loadContainerToSequenceNumber. |
| sealAndCaptureVersionMark() | Beta | VersionMarkCapture | Captures a version mark at the current point. Seals the current outbound batch first (so a just-made local edit has a stable batchId, which is only assigned when a batch is flushed), then returns the mark data atomically: a pending capture (batchId + sequenceNumberLowerBound) when there is an unacked local batch, or a resolved capture (sequenceNumber) when there is no in-flight local work. |
Method Details
onBatchSequenced
Subscribes to inbound batch sequencing: fires (batchId, sequenceNumber) per batch so any connected client can promote a matching pending mark. Returns an unsubscribe function.
For more information about our API support guarantees, see here.
Signature
onBatchSequenced(listener: (batchId: string, sequenceNumber: number) => void): () => void;
Parameters
| Parameter | Type | Description |
|---|---|---|
| listener | (batchId: string, sequenceNumber: number) => void | Called with the stable batch identity and its final sequence number. |
Returns
A function that unsubscribes the listener.
Return type: () => void
resolve
Resolves a pending mark's batchId to a global sequence number (sequenceNumberLowerBound is the exclusive lower bound for a history read). A resolved sequence number feeds the loader's loadContainerToSequenceNumber.
For more information about our API support guarantees, see here.
Signature
resolve(batchId: string, sequenceNumberLowerBound: number): Promise<ResolveResult>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| batchId | string | The stable identity of the pending batch. |
| sequenceNumberLowerBound | number | The exclusive lower bound for the historical op search. |
Returns
The resolved sequence number, or a result indicating that the batch remains pending or can no longer be resolved.
Return type: Promise<ResolveResult>
sealAndCaptureVersionMark
Captures a version mark at the current point. Seals the current outbound batch first (so a just-made local edit has a stable batchId, which is only assigned when a batch is flushed), then returns the mark data atomically: a pending capture (batchId + sequenceNumberLowerBound) when there is an unacked local batch, or a resolved capture (sequenceNumber) when there is no in-flight local work.
For more information about our API support guarantees, see here.
Signature
sealAndCaptureVersionMark(): VersionMarkCapture;
Remarks
Sealing the batch is a side effect (it submits the current batch), so capture at savepoint boundaries, not per keystroke.
Returns
The pending batch identity and exclusive sequence number lower bound, or the current sequence number when there is no pending local batch.
Return type: VersionMarkCapture