Table of Contents

Method SaveCheckpointAsync

Namespace
MailFathom.Application.Synchronization.Checkpoints
Assembly
MailFathom.Application.dll

SaveCheckpointAsync(IPersistenceSession, MailAccountId, MailFolderResolutionId, SynchronizationCheckpoint?, SynchronizationCheckpoint, CancellationToken)

Stages a checkpoint update only when the durable state still matches the state previously read.

Task SaveCheckpointAsync(IPersistenceSession session, MailAccountId accountId, MailFolderResolutionId folderResolutionId, SynchronizationCheckpoint? expectedCheckpoint, SynchronizationCheckpoint checkpoint, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The open session whose transaction the staged update joins.

accountId MailAccountId

The account owning the folder.

folderResolutionId MailFolderResolutionId

The alias binding whose progress advances.

expectedCheckpoint SynchronizationCheckpoint

The durable progress the caller decided from, or null when it expects no checkpoint yet.

checkpoint SynchronizationCheckpoint

The progress to stage.

cancellationToken CancellationToken

Cancels the lookup before anything is staged.

Returns

Task

A task that completes once the update is staged in the caller's session.

Exceptions

PersistenceConcurrencyConflictException

Thrown when durable progress no longer matches expectedCheckpoint. Nothing is staged, because progress that moved must be reread before a new advance is decided rather than overwritten from stale state.