Method HasRecordAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
HasRecordAsync(StoredEmailId, MailboxMutation, MailboxMutationOrigin, CancellationToken)
Reports whether one local email has ever had a mutation of a given kind asked for by a given kind of requester.
Task<bool> HasRecordAsync(StoredEmailId storedEmailId, MailboxMutation mutation, MailboxMutationOrigin origin, CancellationToken cancellationToken)
Parameters
storedEmailIdStoredEmailIdThe local email, which is the identity that survives the email being moved.
mutationMailboxMutationThe change asked for.
originMailboxMutationOriginThe kind of act that asked.
cancellationTokenCancellationTokenCancels the read.
Returns
Remarks
It answers a question the idempotency identity deliberately cannot: whether this email was ever moved by this kind of requester, rather than whether one particular request has already been made. The identity is keyed to the occurrence and to what asked, so a message that has since moved is a new occurrence and a requester whose terms changed is a new requester — both of which ask afresh, which is right for a retry and wrong for deciding whether somebody has since undone the change.
Every stage counts, including an abandoned one. What the caller is establishing is that MailFathom has already acted on this email once, and a change that was attempted and given up on is still a change the owner may have seen and reversed.
Exceptions
- ArgumentException
Thrown when
mutationis unspecified.- ArgumentOutOfRangeException
Thrown when
originis not a declared origin.