Method ReadStateCandidatesAsync
- Namespace
- MailFathom.Application.Synchronization.Restore
- Assembly
- MailFathom.Application.dll
ReadStateCandidatesAsync(MailAccountId, int, CancellationToken)
Reads the messages of a restoring account whose local state has still to be written onto the occurrence they keep.
Task<IReadOnlyList<MailboxRestoredStateCandidate>> ReadStateCandidatesAsync(MailAccountId account, int maximumCandidates, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account.
maximumCandidatesintThe most messages one pass takes in hand.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<IReadOnlyList<MailboxRestoredStateCandidate>>
The messages, oldest first, bounded by what was asked for.
Remarks
These are the messages the drain never reached, so the source still holds them where it always did — with whatever flags it last had, since the source's own values stopped being observed at the switch on.
A message the restore appended can re-enter this walk, and deliberately so. The walk's position is one cursor
per account rather than a stamp per message, so a confirmation cannot mark its own message written without
moving the cursor past every message between — which would silently skip their state. What the cursor costs
instead is bounded and harmless: a message whose identity sorts after the cursor has records opened for the
state its own APPEND already carried, and the converger writes what the source is already showing.
Exceptions
- ArgumentOutOfRangeException
Thrown when
maximumCandidatesis not positive.