Table of Contents

Method ReadAsync

Namespace
MailFathom.Application.Accounts
Assembly
MailFathom.Application.dll

ReadAsync(CancellationToken)

Reads the accounts the caller's user is assigned and their synchronization freshness.

public Task<MailAccountDirectory> ReadAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<MailAccountDirectory>

The user's accounts with their folders, and whether the deployment refreshes them.

Remarks

Nothing here writes, so the operation is safe to repeat, and it sets no remote state because it speaks to no mail server at all.

The grant is asked for before anything is read, and it is asked for here rather than only at the transport that withholds the tool: naming the accounts a caller may reach is publishing that they exist, and an entrypoint added later would otherwise publish them by reaching this use case without passing a filter. Which accounts those are is the catalog's answer rather than this use case's, so the user bound cannot be forgotten here either.

Exceptions

PrincipalNotAuthorizedException

Thrown when the use case was reached by anything but a caller granted MailRead that is acting for a user.