Table of Contents

Method SettleAsync

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

SettleAsync(MailDraftRecord, CancellationToken)

Does whatever one draft's recorded stage says the mailbox is owed, and records what happened.

[SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "A draft whose copy could not be settled is a draft that still exists and is still editable; raising would end the pass that was settling the drafts beside it, and every failure is classified into a recorded code and returned as an outcome instead.")]
public Task<MailDraftFilingResult> SettleAsync(MailDraftRecord draft, CancellationToken cancellationToken)

Parameters

draft MailDraftRecord

The draft, read with its copies.

cancellationToken CancellationToken

Cancels the commands and the writes around them.

Returns

Task<MailDraftFilingResult>

What the attempt did, which is already durable by the time it is returned.

Remarks

A whole replacement is one call: the current revision is appended, and the copy it replaced is removed once the server has confirmed the new one is there. That is what leaves an owner who edited a draft looking at one draft rather than at two for as long as it takes a pass to come round.

Exceptions

ArgumentNullException

Thrown when draft is null.