Table of Contents

Class MailAttachmentTextPass

Namespace
MailFathom.Application.Emails.AttachmentText
Assembly
MailFathom.Application.dll

Reads the attachments of the account's mail the cut has already been through, and offers each message for embedding again.

public sealed class MailAttachmentTextPass
Inheritance
MailAttachmentTextPass
Inherited Members

Remarks

The fifth stage of the arrival pipeline and the last of the run's local passes, which is where it belongs rather than where it happened to fit. It runs behind the cut for one reason: reading an attachment is the only stage that parses octets a stranger composed and the only one that may call a provider, so a message reaches lexical and semantic retrieval on its own words first, and gains its attachments' words when they arrive. A body passage cut by the stage in front of this one is untouched by anything here — its digest, its ordinal, and its vector all stay exactly as they were, which is what stops attachments from re-billing a mailbox that was already embedded.

Nothing is derived inside a transaction. Each message is read whole first — content store, parsers, and where a picture is involved a chat provider — and only then is one statement committed carrying the readings, the passages cut from them, and the stamp that takes the message out of the selection. A crash between the two leaves the message exactly as it was, and the next run repeats the reading rather than half of it.

Three ceilings bound it and they are asked in order of how much they cost to reach. The run's octet budget is a counter in memory, so it is spent inside the derivation itself; the deployment's aggregate ceilings are durable rows and are read once per message, before the message is opened; and the per-attachment and per-message ceilings are applied by the derivation as it walks. Reaching any of them ends the pass with mail still outstanding rather than failing the account run — the work waits for the next run or for the period to roll over, which is what an exhausted embedding budget already does for message text.

It carries a resume position across its batches, which the cut does not need. Most messages leave the selection by being read, but one whose stored copy needs fetching again, or whose picture a provider did not answer for, keeps no stamp on purpose — so without a cursor the next batch would select exactly those messages again, re-read them, and never reach anything behind them, calling the provider once per batch on the way. The position is dropped at the end of the pass rather than persisted: what one pass's budget leaves behind is the next run's, and that run starts at the head of a selection those messages are still in.

Constructors

MailAttachmentTextPass(IStoredEmailAttachmentTextStore, EmailAttachmentTextDeriver, EmailAttachmentTextBounds, IEmailEmbeddingBacklog, IDerivedWorkGateTelemetry, OptimisticConcurrencyRetryPolicy, AttachmentDerivationSpendGate)

Initializes the pass from the state it walks, the derivation it runs, and the backlog it hands messages to.

Methods

RunAsync(MailAccountId, CancellationToken)

Takes one bounded pass over the account's mail awaiting a reading of its attachments.