Skip to main content

IVersionMarkResolver Interface

Runtime-owned resolver for app-stored version mark locators.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-runtime/legacy.

For more information about our API support guarantees, see here.

Signature

export interface IVersionMarkResolver

Methods

MethodAlertsReturn TypeDescription
onBatchSequenced(listener)Beta() => voidSubscribes 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)BetaPromise<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()BetaVersionMarkCaptureCaptures 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.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

onBatchSequenced(listener: (batchId: string, sequenceNumber: number) => void): () => void;

Parameters

ParameterTypeDescription
listener(batchId: string, sequenceNumber: number) => voidCalled 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.

This API is provided for existing users, but is not recommended for new users.

For more information about our API support guarantees, see here.

Signature

resolve(batchId: string, sequenceNumberLowerBound: number): Promise<ResolveResult>;

Parameters

ParameterTypeDescription
batchIdstringThe stable identity of the pending batch.
sequenceNumberLowerBoundnumberThe 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.

This API is provided for existing users, but is not recommended for new users.

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