Table of Contents

Method EraseFolderMirrorAsync

Namespace
MailFathom.Application.Folders
Assembly
MailFathom.Application.dll

EraseFolderMirrorAsync(IPersistenceSession, MailAccountId, MailFolderAlias, int, CancellationToken)

Erases a bounded part of one folder's stored mail, and its checkpoint once nothing is left.

Task<MailFolderMirrorErasure> EraseFolderMirrorAsync(IPersistenceSession session, MailAccountId accountId, MailFolderAlias folderAlias, int maxEmails, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The write transaction this erasure joins.

accountId MailAccountId

The account the folder belongs to.

folderAlias MailFolderAlias

MailFathom's own name for the folder.

maxEmails int

The greatest number of emails this pass may erase.

cancellationToken CancellationToken

Cancels the read that selects the emails and the writes that stage their removal.

Returns

Task<MailFolderMirrorErasure>

What this pass erased, and whether the folder still holds stored mail.

Remarks

The checkpoint is cleared in the same pass that empties the folder rather than in the first one, because a checkpoint removed while mail remains would make a mirrored folder resume in front of rows this pass has not reached. Clearing it at the end is what makes a folder somebody erased mirror afresh, while a folder merely switched off keeps its checkpoint and resumes from it.