Method ReadFilingsAtAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Filing
- Assembly
- MailFathom.Application.dll
ReadFilingsAtAsync(MailAccountId, RemoteFolderPath, ImapUidValidity, IReadOnlyCollection<ImapUid>, IReadOnlyCollection<string>, CancellationToken)
Reads the filings that put a copy into one folder at one of the occurrences a batch discovered.
Task<IReadOnlyList<OutgoingMailFilingRecord>> ReadFilingsAtAsync(MailAccountId accountId, RemoteFolderPath folderPath, ImapUidValidity uidValidity, IReadOnlyCollection<ImapUid> uids, IReadOnlyCollection<string> internetMessageIds, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account whose filings are read.
folderPathRemoteFolderPathThe remote folder being synchronized, which is the folder those filings named.
uidValidityImapUidValidityThe UIDVALIDITY that folder reports now.
uidsIReadOnlyCollection<ImapUid>The UIDs one batch of the forward pass discovered.
internetMessageIdsIReadOnlyCollection<string>The
Message-IDvalues that batch reported, for the servers that name no placement.cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<OutgoingMailFilingRecord>>
Every filing a discovery in that batch could belong to, which may be none.
Remarks
A whole batch is asked about at once, so a folder nothing was ever filed into — which is nearly every folder on nearly every run — costs one query rather than one per message. Both halves of the join are asked in the same read, because a batch can carry discoveries of both kinds and a second query would double the cost of the case that answers nothing.
Which row a given discovery belongs to is then decided by AccountsForPlacementAt(RemoteFolderPath, ImapUidValidity, ImapUid) and AccountsForMessageAt(RemoteFolderPath, string?), which restate every condition of the read rather than trusting it.
Exceptions
- ArgumentNullException
Thrown when
uidsorinternetMessageIdsis null.