Method ReadVersionsAsync
- Namespace
- MailFathom.Infrastructure.Persistence.Users
- Assembly
- MailFathom.Infrastructure.dll
ReadVersionsAsync(int, CancellationToken)
Reads the version the record of every user a mail-serving endpoint may serve stands at, without any record.
Task<IReadOnlyList<UserSettingsDocumentVersion>> ReadVersionsAsync(int limit, CancellationToken cancellationToken)
Parameters
limitintThe greatest number of versions to read.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<UserSettingsDocumentVersion>>
Each such user and the version of their record, in the order the users were recorded in, and no more than
limitof them.
Remarks
What says whether a deployment serves nobody, one user, or several, so it is one statement and sends no document. A user with both mail endpoint switches off — the default administrator, recorded that way — is one no caller naming no user could mean, so it is not counted.
ponytail: counts a user whose switch is on for either surface, where the rule is per surface; a user served on the client alone still counts against an unauthenticated MCP endpoint. Split the count by surface when a deployment needs that combination.
Exceptions
- ArgumentOutOfRangeException
Thrown when
limitis not positive.- UserSettingsUnreadableException
Thrown when the database declined the read.
ReadVersionsAsync(IReadOnlyCollection<UserId>, CancellationToken)
Reads the version the record of each named user stands at, without any record.
Task<IReadOnlyList<UserSettingsDocumentVersion>> ReadVersionsAsync(IReadOnlyCollection<UserId> users, CancellationToken cancellationToken)
Parameters
usersIReadOnlyCollection<UserId>The users asked about.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<UserSettingsDocumentVersion>>
Each named user this deployment still holds and the version of their record; a user it no longer holds is absent.
Remarks
What a replica compares the users it has composed against, so it is one statement and sends no document: a record is read only once its version says it moved.
Exceptions
- ArgumentNullException
Thrown when
usersis null.- UserSettingsUnreadableException
Thrown when the database declined the read.