Method RewindAsync
- Namespace
- MailFathom.Application.Mail.Maintenance
- Assembly
- MailFathom.Application.dll
RewindAsync(StoredMailScope, CancellationToken)
Discards the durable progress of the scope's bindings in one transaction.
public Task<IReadOnlyList<MailFolderAlias>> RewindAsync(StoredMailScope scope, CancellationToken cancellationToken)
Parameters
scopeStoredMailScopeThe account, and the one folder of it, whose progress is discarded.
cancellationTokenCancellationTokenCancels the removal before or during its single transaction.
Returns
- Task<IReadOnlyList<MailFolderAlias>>
The aliases whose bindings held progress, ordered and without repeats.
Remarks
One transaction for the whole scope rather than a bounded pass per folder. What it removes is one row per binding, so an account's worth of it is a handful of rows however much mail those bindings cover, and a partial rewind would leave an account whose folders resume from different points for no benefit.
It makes the deployment pull a mailbox over IMAP again, which is asking it to do work it can already do, so the operating grant is what reaches it and reading the assessment beforehand does not.
Exceptions
- ArgumentNullException
Thrown when
scopeis null.- PersistenceConcurrencyConflictException
Thrown when a competing writer wins a race the bounded retries could not resolve.
- PrincipalNotAuthorizedException
Thrown when the use case was reached by anything but a caller granted AdminOperate.