Table of Contents

Interface IMailDraftStore

Namespace
MailFathom.Application.Mail.Delivery.Drafts
Assembly
MailFathom.Application.dll

Keeps the durable account of every draft this deployment holds and every copy of one it appended.

public interface IMailDraftStore

Remarks

A draft's state is written down before the mail server is touched and advanced as each command is answered, which is the same discipline the outgoing record and the mutation record follow and for the same reason: a replacement is two commands with a crash window between them, and the record is what a resumed attempt reads instead of inspecting a folder afterwards.

The copies are a list because a revision that has not finished leaves two of them standing. What decides which is which is the revision number rather than an ordering, so a resumed attempt reaches the same answer whichever order the rows come back in.

Nothing here carries mail content. A folder, an alias, a UID, an identity MailFathom minted, and the addresses a promotion would need are what a row holds, and the message stays in the content store.

Methods

FindAsync(MailDraftId, CancellationToken)

Reads one draft with its copies, or answers that nothing is held under that identifier.

FindPromotedToAsync(OutgoingEmailId, CancellationToken)

Reads the draft a promotion wrote one outgoing record for.

OpenAsync(IPersistenceSession, MailAccountId, OutgoingEmailRequester, IReadOnlyList<OutgoingRecipient>, long, DateTimeOffset, CancellationToken)

Writes down a new draft, at the revision its first stored message is.

ReadOutstandingAsync(MailAccountId, int, CancellationToken)

Reads the drafts of one account that still owe the mail server something.

RecordAppendConfirmedAsync(IPersistenceSession, MailDraftId, AppendedMailCopy, CancellationToken)

Writes down what the server said about the copy it accepted.

RecordAppendIssuedAsync(IPersistenceSession, MailDraftId, MailFolderResolution, DateTimeOffset, CancellationToken)

Writes down that an append of the current revision is about to be issued, before the command goes out.

RecordCopySettledAsync(IPersistenceSession, MailDraftId, int, MailDraftCopyStage, DateTimeOffset, CancellationToken)

Writes down what became of one copy once nothing more will be asked of it.

RecordDiscardedAsync(IPersistenceSession, MailDraftId, DateTimeOffset, CancellationToken)

Writes down that this draft has been given up, before its copies are taken out of the folder.

RecordDivergenceAsync(MailDraftId, MailDraftDivergenceReason, DateTimeOffset, CancellationToken)

Records that the tracked copy stopped being one MailFathom may replace or remove.

RecordFailureAsync(MailDraftId, MailFathomErrorCode, CancellationToken)

Records why the last attempt against the mail server did not leave this draft where it belongs.

RecordPromotedAsync(IPersistenceSession, MailDraftId, OutgoingEmailId, CancellationToken)

Writes down the outgoing record a promotion produced for this draft.

RemoveAsync(IPersistenceSession, MailDraftId, CancellationToken)

Removes one draft and everything held under it.

ReviseAsync(IPersistenceSession, MailDraftId, IReadOnlyList<OutgoingRecipient>, long, DateTimeOffset, CancellationToken)

Advances a draft to a new revision, before any command replacing its copy goes out.