Method ReadableScope
- Namespace
- MailFathom.Application.Emails.Mailboxes
- Assembly
- MailFathom.Application.dll
ReadableScope(IReadOnlyList<MailAccountId>, IReadOnlyList<MailFolderAlias>)
Normalizes a requested scope and restricts it to the accounts this deployment serves.
public MailboxScope ReadableScope(IReadOnlyList<MailAccountId> accountIds, IReadOnlyList<MailFolderAlias> folderAliases)
Parameters
accountIdsIReadOnlyList<MailAccountId>The accounts a request named, or empty for every served account.
folderAliasesIReadOnlyList<MailFolderAlias>The folder aliases a request named, or empty for every folder.
Returns
- MailboxScope
The scope a query runs with.
Remarks
An account the deployment does not serve is refused before anything is read, rather than narrowed away by a predicate: a narrowed predicate would answer with an empty result, and an empty result tells a caller that the identifier they named exists. The check runs against the normalized scope, so the same request cannot be written two ways to reach two answers.
A request that names no account is restricted to the served accounts rather than left unrestricted. Removing an account from configuration leaves its stored rows in place, so an absent account predicate would keep publishing mail from an account this deployment no longer serves — which is also why the resolved accounts, not the requested ones, take part in a continuation cursor's fingerprint.
Exceptions
- MailboxQueryFilterInvalidException
Thrown when either list names more values than its limit permits.
- MailAccountNotAccessibleException
Thrown when the request names an account this deployment does not serve.