Table of Contents

Method EraseAsync

Namespace
MailFathom.Application.Access
Assembly
MailFathom.Application.dll

EraseAsync(UserId, IReadOnlyList<Guid>, CancellationToken)

Erases one user and everything this deployment recorded for them.

Task<UserErasureOutcome> EraseAsync(UserId user, IReadOnlyList<Guid> quiescedAccounts, CancellationToken cancellationToken)

Parameters

user UserId

The user to remove.

quiescedAccounts IReadOnlyList<Guid>

The mail accounts the caller has stopped every writer against and is holding stopped for the whole call. An account the transaction finds itself about to delete and which is not among these refuses the erasure.

cancellationToken CancellationToken

Cancels the erasure before it commits, leaving the deployment unchanged.

Returns

Task<UserErasureOutcome>

What the attempt removed, or the account that stopped it removing anything.

Remarks

The whole of it commits or none of it does, because a partial erasure is a data-subject request answered with half of somebody's mail still stored. An erasure that removed nothing and was not refused is the repeat of one that already ran rather than a failure: what the caller asked for is that the deployment hold nothing for this user, and it does.

The accounts are handed in rather than discovered here because stopping a writer is the caller's act and takes a lease no adapter of this port owns. What this port then owes is the other half: the set it is about to delete is recomputed inside the transaction, so an account that became solely this user's after the caller read that set refuses rather than being deleted with nothing holding it still.

Exceptions

ArgumentException

Thrown when user names nobody.

ArgumentNullException

Thrown when quiescedAccounts is null.