Interface IEmailMetadataRepository
- Namespace
- MailFathom.Application.Synchronization
- Assembly
- MailFathom.Application.dll
Persists email metadata independently from raw MIME content.
public interface IEmailMetadataRepository
Remarks
The port narrows persistence to the single idempotent operation synchronization needs, which is the use-case-shaped
contract
ADR 0001
chose over a generic repository or an exposed IQueryable. It also has no published
contract to restate: EF Core's query surface is a concrete DbContext, and MailFathom allows no fake provider to
stand in for PostgreSQL semantics, so the upsert is expressed in domain terms and asserted through this port.
Methods
- FindFiledSentCopiesAsync(MailAccountId, IReadOnlyCollection<string>, CancellationToken)
Finds the sent copies MailFathom filed locally that carry one of a batch's
Message-IDvalues and no occurrence yet.
- RecordFiledFromOutgoingAsync(IPersistenceSession, StoredEmailId, OutgoingEmailId, CancellationToken)
Records that one stored email is the copy MailFathom itself filed of a message it sent.
- StoreFiledEmailAsync(IPersistenceSession, MailAccountId, MailFolderResolutionId, ExtractedEmailMetadata?, long, AppendedMailFlags, OutgoingEmailId?, CancellationToken)
Stores a message MailFathom filed itself into a held account's local folder, with no occurrence on any server.
- StoreLocalCopyAsync(IPersistenceSession, MailAccountId, MailFolderResolutionId, ExtractedEmailMetadata?, long, CopiedMailFlags, CancellationToken)
Stores the second message a copy on a held account produces, with no occurrence on any server.
- TryCarryToOccurrenceAsync(IPersistenceSession, StoredEmailId, EmailOccurrenceId, CancellationToken)
Moves one stored email onto the occurrence a relocation put it at, instead of storing a second email there.
- UpsertMetadataAsync(IPersistenceSession, RemoteEmailMetadata, ExtractedEmailMetadata?, StoredEmailContentAvailability, CancellationToken)
Inserts or updates metadata for one remote occurrence idempotently and returns its stable local identity.