Table of Contents

Method ReviseAsync

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

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

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

Task<MailDraftRecord> ReviseAsync(IPersistenceSession session, MailDraftId draftId, IReadOnlyList<OutgoingRecipient> recipients, long mimeByteLength, DateTimeOffset revisedAt, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The session the write joins, which is the one the new message is stored in.

draftId MailDraftId

The draft being revised.

recipients IReadOnlyList<OutgoingRecipient>

The people the new revision is addressed to.

mimeByteLength long

How many bytes the new stored message is.

revisedAt DateTimeOffset

When the revision was written down.

cancellationToken CancellationToken

Cancels the write.

Returns

Task<MailDraftRecord>

The draft as the write left it, with the copy it replaces now superseded.

Remarks

It writes nothing about the mail server and issues no command. What it does is make the intent durable — this is now revision n, and the copy carrying revision n-1 is one to take back out — so a process that dies before either command still leaves the previous copy standing and nameable, which is one draft rather than none.

Exceptions

ArgumentNullException

Thrown when session or recipients is null.

InvalidOperationException

Thrown when no draft is held under draftId, or when it has already been discarded.