Table of Contents

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

accountId MailAccountId

The account whose filings are read.

folderPath RemoteFolderPath

The remote folder being synchronized, which is the folder those filings named.

uidValidity ImapUidValidity

The UIDVALIDITY that folder reports now.

uids IReadOnlyCollection<ImapUid>

The UIDs one batch of the forward pass discovered.

internetMessageIds IReadOnlyCollection<string>

The Message-ID values that batch reported, for the servers that name no placement.

cancellationToken CancellationToken

Cancels 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 uids or internetMessageIds is null.