Configurable message retention #13

Closed
opened 2026-07-01 03:07:37 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-01 03:07:37 +00:00 (Migrated from github.com)

Context

No retention exists yet. Add a user-configurable limit on how much mail is kept on the
device
(by count and/or age); mail beyond the limit is deleted locally but never from the
server. Default: keep everything (matches #12).

Scope

  • Retention setting: by count (last N messages) and/or age (last N months), plus an
    explicit "keep everything" default.
  • Decide per-account vs global (suggest per-account with a global default; see
    AccountSettings).
  • Pruning worker (WorkManager) that deletes local messages/bodies/attachments exceeding
    the limit; never issues server deletes; cascades cached rows.
  • Interaction with #12 backfill: pruning must not fight an in-progress backfill (don't
    delete what's actively being fetched; define precedence).
  • Settings UI + copy making clear this is "device only, not the server."

Acceptance criteria

  • Setting a count/age limit prunes local mail beyond it and stops re-downloading it; the
    server copy is untouched.
  • Default leaves all mail on device.

Relevant files

  • data/settings/* (new keys), ui/settings/*, new pruning worker,
    data/local/dao/MessageDao.kt

Dependencies

Pairs with #12; together they define DB size relevant to #21 / #22.

## Context No retention exists yet. Add a user-configurable limit on how much mail is kept **on the device** (by count and/or age); mail beyond the limit is deleted locally but never from the server. Default: keep everything (matches #12). ## Scope - [ ] Retention setting: by count (last N messages) and/or age (last N months), plus an explicit "keep everything" default. - [ ] Decide per-account vs global (suggest per-account with a global default; see `AccountSettings`). - [ ] Pruning worker (WorkManager) that deletes local messages/bodies/attachments exceeding the limit; never issues server deletes; cascades cached rows. - [ ] Interaction with #12 backfill: pruning must not fight an in-progress backfill (don't delete what's actively being fetched; define precedence). - [ ] Settings UI + copy making clear this is "device only, not the server." ## Acceptance criteria - Setting a count/age limit prunes local mail beyond it and stops re-downloading it; the server copy is untouched. - Default leaves all mail on device. ## Relevant files - `data/settings/*` (new keys), `ui/settings/*`, new pruning worker, `data/local/dao/MessageDao.kt` ## Dependencies Pairs with **#12**; together they define DB size relevant to **#21** / **#22**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#13