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**.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
explicit "keep everything" default.
AccountSettings).the limit; never issues server deletes; cascades cached rows.
delete what's actively being fetched; define precedence).
Acceptance criteria
server copy is untouched.
Relevant files
data/settings/*(new keys),ui/settings/*, new pruning worker,data/local/dao/MessageDao.ktDependencies
Pairs with #12; together they define DB size relevant to #21 / #22.