Method SettleFiledCopiesAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Filing
- Assembly
- MailFathom.Application.dll
SettleFiledCopiesAsync(OutgoingEmailId, CancellationToken)
Brings the copies of one settled send up to date: the mirror goes, and the sent copy arrives.
public Task<IReadOnlyList<OutgoingMailFilingResult>> SettleFiledCopiesAsync(OutgoingEmailId outgoingEmailId, CancellationToken cancellationToken)
Parameters
outgoingEmailIdOutgoingEmailIdThe send whose attempt has just ended.
cancellationTokenCancellationTokenCancels the reads and the appends.
Returns
- Task<IReadOnlyList<OutgoingMailFilingResult>>
What each attempt did, which is empty for a send that is still queued.
Remarks
The record is read again rather than taken from the attempt, because the attempt handed back what it decided and this needs what was committed — including the filing rows an earlier pass wrote, which no delivery result carries.
The order is deliberate. The mirror is withdrawn first, so a folder the owner is looking at never shows the same message as both waiting and sent; the sent copy is appended only after a delivery the server acknowledged, which is the one point at which saying this was sent is true.
It is keyed on the send having reached a terminal stage rather than on how it got there, so every path that settles one calls this and none of them needs its own withdrawal. A send that ends without an attempt has the mirror taken out of the folder and nothing appended in its place, because the only copy such a message ever earned was the one that said it was waiting.