Table of Contents

Class SynchronizationNotifications

Namespace
MailFathom.Application.Notifications
Assembly
MailFathom.Application.dll

Turns what a synchronization run observed into what the account's assigned users are told about it.

public sealed class SynchronizationNotifications
Inheritance
SynchronizationNotifications
Inherited Members

Remarks

The run is the only producer wired today, and it produces two things: that mail arrived, and that something about the account needs a person. Both are facts the service holds and the client cannot derive, which is the whole reason the record exists.

Mail is reported once per run rather than once per message. A run that commits forty messages is one arrival to the person who was away from the screen, and forty rows would bury every other kind of notification under one mailbox's traffic. The count is the run's, and the row leads to the mailbox rather than to any one message, because there is no one message a run is about.

Nothing composed here reads mail. A count, an account identifier, and a fixed sentence are what a row carries, so no subject, address, body fragment, filename, or credential can reach the record, a log, or a telemetry event through this path.

Every raise states its condition twice, in the two forms a notification is read in. The statement is the condition itself and the numbers it is made with, which is what a client turns into a sentence in whatever language the person reading it has; the title and the body beside it are that same condition written out in English, for a reader with no client to say it in their own. Both are composed here from the same values, so the two cannot come to describe different runs.

A row that was kept is also announced to whatever the user has open, which is NotificationRaiser's half of the raise rather than this producer's: writing and announcing are one act, and a row the deduplication rule folded into a standing one is not announced for the same reason it is not written.

A notification is one person's, so a mailbox assigned to several people is one condition raised once for each of them: the run observed one thing about one account, and each of the people served by it has their own unread list and their own deduplication. An account assigned to nobody raises nothing, which is the same answer the signal channel gives — there is nobody the condition is about.

Constructors

SynchronizationNotifications(NotificationRaiser, IMailAccountAssignments, TimeProvider)

Initializes the producer from the record it raises into.

Methods

ReportArrivedMailAsync(MailAccountId, int, CancellationToken)

Reports the mail one run committed, as one notification for the run.

ReportIncompleteRunAsync(MailAccountId, int, int, CancellationToken)

Reports a run that ended with folders it did not finish.

ReportRefusedCredentialAsync(MailAccountId, CancellationToken)

Reports an account whose credential the mail server refused.