Table of Contents

Method DiscardCheckpointsAsync

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

DiscardCheckpointsAsync(IPersistenceSession, MailAccountId, MailFolderAlias?, CancellationToken)

Stages the removal of the durable progress of an account's bindings, or of one alias of it.

Task<IReadOnlyList<MailFolderAlias>> DiscardCheckpointsAsync(IPersistenceSession session, MailAccountId accountId, MailFolderAlias? folderAlias, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The open session whose transaction the staged removal joins.

accountId MailAccountId

The account whose progress is discarded.

folderAlias MailFolderAlias?

The one alias to discard the progress of, or null for every binding of the account.

cancellationToken CancellationToken

Cancels the read that selects the bindings and the writes that stage their removal.

Returns

Task<IReadOnlyList<MailFolderAlias>>

The aliases whose bindings held progress, ordered and without repeats.

Remarks

The UID progress and the reconciled modification sequence go together, because they describe one UIDVALIDITY scope: leaving the sequence behind would tell the backward pass that everything older than it is already accounted for, over a forward pass that is about to read the folder from its first UID again.

Removal rather than an emptied row, so a binding reads exactly as one that has never been synchronized — which is what makes the next run start at the first UID inside the account's window rather than resume. It is also what makes a run that is in flight lose the race safely: that run decided from progress that no longer exists, so SaveCheckpointAsync(IPersistenceSession, MailAccountId, MailFolderResolutionId, SynchronizationCheckpoint?, SynchronizationCheckpoint, CancellationToken) refuses its advance instead of writing a checkpoint in front of mail the discarded progress was about to have re-read.

The removal is per binding rather than per alias. A repointed alias carries a binding of its own and progress of its own, so discarding by alias alone would leave the older binding's progress behind under a name nothing reads it by.