Method RecordPlacementObservedAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
RecordPlacementObservedAsync(IPersistenceSession, MailboxMutationRecordId, DateTimeOffset, CancellationToken)
Writes down that the occurrence a relocation created has been recognized and the local row carried onto it.
Task RecordPlacementObservedAsync(IPersistenceSession session, MailboxMutationRecordId recordId, DateTimeOffset observedAt, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins, which is the one the row is carried across in.
recordIdMailboxMutationRecordIdThe record whose placement was recognized.
observedAtDateTimeOffsetWhen the run recognized it.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task
A task that completes when the observation is written.
Remarks
It settles the source half as well, for a mutation that has one. Carrying the row across is what takes the email out of the source folder locally, so no later window can select it there and no later run can observe the disappearance the record is otherwise still waiting for. The stage this is only ever reached from is Completed, which is the server's own statement that the source occurrence is already gone. A copy leaves its source where it was and settles nothing about it.
Writing it is also what expires the suppression. A record whose placement has been observed answers for no later discovery, which is what keeps a folder recreated under a reused UID from being attributed to a mutation made against the previous one.
Exceptions
- ArgumentNullException
Thrown when
sessionis null.- InvalidOperationException
Thrown when no record carries
recordId.