Table of Contents

Method ReadMutationsRemovingAsync

Namespace
MailFathom.Application.Mail.Mutations
Assembly
MailFathom.Application.dll

ReadMutationsRemovingAsync(MailAccountId, MailFolderResolutionId, ImapUidValidity, IReadOnlyCollection<ImapUid>, CancellationToken)

Reads the mutations issued against any of the source occurrences a reconciliation window found gone.

Task<IReadOnlyList<MailboxMutationRecord>> ReadMutationsRemovingAsync(MailAccountId accountId, MailFolderResolutionId folderResolutionId, ImapUidValidity uidValidity, IReadOnlyCollection<ImapUid> uids, CancellationToken cancellationToken)

Parameters

accountId MailAccountId

The account whose mutations are read.

folderResolutionId MailFolderResolutionId

The alias binding the occurrences were stored under.

uidValidity ImapUidValidity

The UIDVALIDITY the window was opened for.

uids IReadOnlyCollection<ImapUid>

The UIDs the folder no longer holds.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<MailboxMutationRecord>>

Every record issued against one of those occurrences, which may be none.

Remarks

The whole window is asked about at once, so attributing a window's disappearances costs one query rather than one per email. A record that already carries its observation is part of the answer: it stays the durable reason that occurrence is gone, and a window that asks about the same disappearance again must get the same answer rather than fall through to the path that handles somebody else's deletion.

The answer is bounded by uids and by the schema rather than by a limit of its own, and that is deliberate. One occurrence can carry several records — the idempotency identity is the occurrence, the requester, and the mutation together — so the rows are the window's occurrences times the requesters that asked something of each, which is a handful. A count limit on top would be the wrong shape: it would truncate whichever occurrences sorted last, and an occurrence whose record was cut would be attributed to nobody and reach the remote-deletion path, which is the one outcome this read exists to prevent.

Exceptions

ArgumentNullException

Thrown when uids is null.