Table of Contents

Method ReadSolelyAssignedAsync

Namespace
MailFathom.Infrastructure.Persistence.Users
Assembly
MailFathom.Infrastructure.dll

ReadSolelyAssignedAsync(UserId, CancellationToken)

Reads the accounts one user is assigned and nobody else is.

Task<IReadOnlyList<Guid>> ReadSolelyAssignedAsync(UserId user, CancellationToken cancellationToken)

Parameters

user UserId

The user asked about.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<Guid>>

The accounts that would be left serving nobody if this user's assignments ended, in ordinal order.

Remarks

It is what an erasure has to know before it begins rather than after: the accounts whose work has to be stopped are exactly these. An account somebody else still reads is left running and unheld, because the mailbox and its mail are that person's — the erasure still takes what the departing user authored in it, their drafts and their recurring sends, and those rows key onto the user rather than needing the mailbox to be still. The set is read from the assignment relation rather than from the users a replica has composed, so an account assigned to a user whose record this build will not read still counts as shared.

It is the one read here that takes no ceiling, and deliberately: a truncated answer would leave an account of the user's running while the erasure deleted its mail, which is the failure the caller asks this question to avoid. What bounds it instead is the deployment — these are the assignments of one user, the same set the erasure's own transaction narrows on — so the alternative to reading all of them is not a smaller read but a wrong one.

Exceptions

ArgumentException

Thrown when user names nobody.