Table of Contents

Class NotificationRetention

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

Ages one user's notifications out at the bound the record is held to.

public sealed class NotificationRetention
Inheritance
NotificationRetention
Inherited Members

Remarks

A notification is derived personal data — it says what reached a person's mailbox and when — so a table nobody prunes becomes a mailbox history in miniature, held for longer than anybody undertook to hold it. The bound is what stops that, and it is the record's own rather than an account's: notifications belong to the user, and a user reading one notification centre cannot have two answers about how long it remembers.

It rides the account's own synchronization run, beside the retention passes already there, for the reason those ride it: an account already has a loop that comes round, and a schedule of its own would be another thing to configure and watch for one bounded delete. A user with several accounts is therefore swept once per account, which costs a query that erases nothing rather than a second mechanism.

Constructors

NotificationRetention(INotificationStore, TimeProvider)

Initializes the retention pass from the record it erases from.

Fields

MaximumNotificationsErasedPerPass

The greatest number of notifications one pass erases.

Window

How long a notification is kept after the thing it describes happened.

Methods

EraseExpiredAsync(UserId, CancellationToken)

Erases everything of one user's that has outlived the window.