Second finding from the legal-hold audit, same root shape as #377 (a deleted-but-kept account drops out of the live-account scans holds rely on), different code path.
held_accounts() — the set the retention purges keep records for — scanned only live accounts. So an account deleted while undelete still kept it (the case a hold is placed for) was absent:
audit_purge consults held_accounts() directly, so a deleted-but-held account's audit trail was purged once past the 90-day floor, while the hold was active.
The journal purge augmented the set at its own call site, so it was affected only in the narrower case where the hold covered no live account at all.
Fix
held_accounts() now folds in the accounts undelete keeps that a hold covers (through the domain and tenant their retained record carries), so every purge that trusts it — audit and journal — keeps a deleted-but-held account's records. The journal call site's now-redundant augmentation is removed, leaving one source of truth. +9/-8 across crates/common/src/hold.rs and crates/services/src/task_manager/maintenance.rs.
Clean room
Worked only against inbuxa's own tree — the held_accounts/journal-purge hooks in crates/common and crates/services, and the existing legal_hold test. No Stalwart Enterprise-licensed source was read.
Testing
legal_hold_tests now also asserts a deleted-but-held custodian is present in held_accounts() — the gate audit and journal purges use. Verified locally (RED without the fix, GREEN with it). CI does not run the #[ignore]d system suite, so this was checked locally.
Run: RUST_MIN_STACK=16777216 STORE=RocksDb cargo test -p tests legal_hold_tests -- --ignored
Pairs with #377; both are items in one compliance/data-loss advisory (spoliation under an active legal hold) — advisory + release notes to follow.
## What
Second finding from the legal-hold audit, same root shape as #377 (a deleted-but-kept account drops out of the live-account scans holds rely on), different code path.
`held_accounts()` — the set the retention purges keep records for — scanned only live accounts. So an account deleted while undelete still kept it (the case a hold is placed for) was absent:
- `audit_purge` consults `held_accounts()` directly, so a deleted-but-held account's **audit trail** was purged once past the 90-day floor, while the hold was active.
- The journal purge augmented the set at its own call site, so it was affected only in the narrower case where the hold covered no live account at all.
## Fix
`held_accounts()` now folds in the accounts undelete keeps that a hold covers (through the domain and tenant their retained record carries), so every purge that trusts it — audit and journal — keeps a deleted-but-held account's records. The journal call site's now-redundant augmentation is removed, leaving one source of truth. +9/-8 across `crates/common/src/hold.rs` and `crates/services/src/task_manager/maintenance.rs`.
## Clean room
Worked only against inbuxa's own tree — the `held_accounts`/journal-purge hooks in `crates/common` and `crates/services`, and the existing `legal_hold` test. No Stalwart Enterprise-licensed source was read.
## Testing
`legal_hold_tests` now also asserts a deleted-but-held custodian is present in `held_accounts()` — the gate audit and journal purges use. Verified locally (RED without the fix, GREEN with it). CI does not run the `#[ignore]`d system suite, so this was checked locally.
Run: `RUST_MIN_STACK=16777216 STORE=RocksDb cargo test -p tests legal_hold_tests -- --ignored`
Pairs with #377; both are items in one compliance/data-loss advisory (spoliation under an active legal hold) — advisory + release notes to follow.
held_accounts() scanned only live accounts, so an account deleted while
undelete still kept it -- the case a legal hold is placed for -- was absent
from the set the retention purges trust. audit_purge consults it directly,
so a deleted-but-held account's audit trail was purged once past the 90-day
floor while the hold was active. The journal purge augmented the set at its
own call site, so it was affected only when a hold covered no live account.
held_accounts() now folds in the accounts undelete keeps that a hold covers,
through the domain and tenant their retained record carries, so every purge
that trusts it keeps a deleted-but-held account's records. The journal call
site's now-redundant augmentation is removed, leaving one source of truth.
Covered by legal_hold_tests: a deleted-but-held custodian is now present in
held_accounts() (LH-6, AU-7).
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.
What
Second finding from the legal-hold audit, same root shape as #377 (a deleted-but-kept account drops out of the live-account scans holds rely on), different code path.
held_accounts()— the set the retention purges keep records for — scanned only live accounts. So an account deleted while undelete still kept it (the case a hold is placed for) was absent:audit_purgeconsultsheld_accounts()directly, so a deleted-but-held account's audit trail was purged once past the 90-day floor, while the hold was active.Fix
held_accounts()now folds in the accounts undelete keeps that a hold covers (through the domain and tenant their retained record carries), so every purge that trusts it — audit and journal — keeps a deleted-but-held account's records. The journal call site's now-redundant augmentation is removed, leaving one source of truth. +9/-8 acrosscrates/common/src/hold.rsandcrates/services/src/task_manager/maintenance.rs.Clean room
Worked only against inbuxa's own tree — the
held_accounts/journal-purge hooks incrates/commonandcrates/services, and the existinglegal_holdtest. No Stalwart Enterprise-licensed source was read.Testing
legal_hold_testsnow also asserts a deleted-but-held custodian is present inheld_accounts()— the gate audit and journal purges use. Verified locally (RED without the fix, GREEN with it). CI does not run the#[ignore]d system suite, so this was checked locally.Run:
RUST_MIN_STACK=16777216 STORE=RocksDb cargo test -p tests legal_hold_tests -- --ignoredPairs with #377; both are items in one compliance/data-loss advisory (spoliation under an active legal hold) — advisory + release notes to follow.