Class MailboxMutationConverger
- Namespace
- MailFathom.Application.Mail.Mutations.Convergence
- Assembly
- MailFathom.Application.dll
Drives one account's unfinished mutations towards the only two endings a change is allowed to have.
public sealed class MailboxMutationConverger
- Inheritance
-
MailboxMutationConverger
- Inherited Members
Remarks
The durable record makes a remote write resumable; this is what makes it converge. A mutation somebody authored is not a request that succeeded or failed at one moment — it is a state the mailbox is heading for — and the endings are completed, or given up on where a person can see it. Pending forever is the third ending this exists to remove, because it looks exactly like success from every screen an operator reads.
A pass is deliberately not a retry loop. It takes each outstanding record in hand once and either moves it or leaves it, and everything about *when* to come back belongs to the account's synchronization schedule: an unreachable server fails the run, the run's jittered backoff defers the next one, and the mutation's own attempt bound decides when a change that keeps failing stops being attempted. Adding a wait here would put a second retry policy around the same commands, which is the storm both the resilience pipeline and that backoff are shaped to avoid.
Resuming is one call: the request is read back off the record and handed to the performer, which finds the record by its idempotency identity, counts the attempt, and continues the protocol sequence from the stage the record names. Nothing here knows what a relocation is made of, and nothing here decides which command to skip.
The one case that is not resumed is a placement whose answer never came back. Reissuing it would put a second message in the destination folder and nothing there afterwards would say which one MailFathom made, so it is settled from what the mailbox has since shown about the source occurrence, or given up on when it stays unsettled for the configured grace period.
Constructors
- MailboxMutationConverger(IMailboxMutationRecordStore, IMailboxMutationPerformer, IMailTransportSecurityPolicyReader, OptimisticConcurrencyRetryPolicy, MailboxConvergenceOptions, TimeProvider)
Initializes the converger from the record store and the one path able to perform a change.
Methods
- ConvergeAsync(MailAccountId, CancellationToken)
Takes one bounded pass over everything the account has asked a mail server for and not seen finished.