Class MailSynchronizationRewind
- Namespace
- MailFathom.Application.Mail.Maintenance
- Assembly
- MailFathom.Application.dll
Discards an account's durable synchronization progress so its next run reads its folders afresh.
public sealed class MailSynchronizationRewind
- Inheritance
-
MailSynchronizationRewind
- Inherited Members
Remarks
The expensive half of filling in properties a newer release added. The forward pass asks a server only about UIDs above the folder's checkpoint and the backward pass reconciles what disappeared, so mail already mirrored keeps whatever shape it had on the day it arrived — and the only thing that makes a run read it again is the progress it resumes from no longer being there. Everything the server knows is then re-read, including what the stored payload never carried: flags, keywords, the internal date, whatever a later release starts recording from the envelope.
What it costs is the whole scope off the wire, back through MIME extraction, and back into the content store, which is why the count is read separately and put in front of the operator before anything is discarded. StoredMailRederivation is the cheap answer wherever the property is already in the stored payload.
Nothing here reaches a mail server, and nothing here removes mail. Re-reading an occurrence upserts the local email it already stored rather than storing a second one, so what a rewind costs is a fetch rather than a mailbox.
Constructors
- MailSynchronizationRewind(ISynchronizationCheckpointStore, IStoredMailCounter, OptimisticConcurrencyRetryPolicy, AccessAuthorization)
Initializes the rewind.
Methods
- AssessAsync(StoredMailScope, CancellationToken)
Reports how much mail a rewind of one scope would have the next runs read again.
- RewindAsync(StoredMailScope, CancellationToken)
Discards the durable progress of the scope's bindings in one transaction.