Class MailAccountFreshnessReader
- Namespace
- MailFathom.Application.Accounts
- Assembly
- MailFathom.Application.dll
Reads the caller's own accounts as one line each — which account it is and whether its local copy is current — and the same reading for every folder that answers for one.
public sealed class MailAccountFreshnessReader
- Inheritance
-
MailAccountFreshnessReader
- Inherited Members
Remarks
It answers the same question MailAccountDirectoryReader does and answers it at a different size. That use case publishes what synchronization durably committed, folder by folder; a reader deciding whether to trust the mailbox needs that reduced to one instant and one word per folder, and to one of each for the account above them.
Composed over that use case rather than beside it, so the two cannot come to disagree about which accounts a user has. Whose accounts these are, which folders count, the grant that is required, and the read that is recorded are all decided there, once; what is added here is the reading none of those sources holds on its own.
The account's own state is the reduction of its folders' states rather than a second derivation beside them, which is what keeps a folder tree and the mailbox list above it from disagreeing about the same account. A folder that failed outranks one whose server was unreachable, because a run that also failed some other way reached the server; the account's own run answers for what no folder reports, which is a failure to carry its outstanding mailbox changes.
The state is what this process has observed. MailSynchronizationRunLedger is deliberately not durable, so a process that has just started reports an account it has not run yet by what its stored progress says rather than by how its runs were going before the restart — which is the honest answer, since the backoff that was failing is not one this process is applying.
It reaches no mail server and returns no mail: an account's generated identifier, its display name, its folders' aliases, one instant apiece, and one state apiece are the whole of what a caller receives.
Constructors
- MailAccountFreshnessReader(MailAccountDirectoryReader, MailSynchronizationRunLedger)
Initializes the use case.
Methods
- ReadAsync(CancellationToken)
Reads the caller's accounts and how current each one and each of its folders is.