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
sessionIPersistenceSessionThe open session whose transaction the staged update joins.
accountIdMailAccountIdThe account owning the folder.
folderResolutionIdMailFolderResolutionIdThe alias binding whose progress advances.
expectedCheckpointSynchronizationCheckpointThe durable progress the caller decided from, or null when it expects no checkpoint yet.
checkpointSynchronizationCheckpointThe progress to stage.
cancellationTokenCancellationTokenCancels 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.