Auto-purge stored crash / problem reports older than 1 month from the device, triggered when the device connects to a charger, so debug records don't accumulate indefinitely on-device.
Trigger
Use a WorkManager job with a charging constraint (setRequiresCharging(true)) — battery-safe and consistent with the app's existing WorkManager scheduling (SyncScheduler, PruneWorker). Prefer this over a raw ACTION_POWER_CONNECTEDBroadcastReceiver (can't be manifest-registered on modern Android and wakes the app unnecessarily). A periodic job that runs in a charging window, or a one-time job enqueued on charge, both work.
Purge
Delete stored reports with createdAtMillis older than 30 days (a RETENTION constant). The reports are file-backed via ReportStore (not Room — per the ReportUploadWorker path), so this is file cleanup, not a DB query.
Age is the sole criterion per the request (purge submitted and unsubmitted alike once older than the cutoff).
Notes
Unit-test the cutoff (a 29-day-old report survives; a 31-day-old one is purged); make it idempotent.
Schedule the worker at startup, mirroring PruneWorker/BackfillWorker via SyncScheduler. ReportStore is file-backed so it needs no DB access — but if any cache-DB dep sneaks in, gate it on EncryptedCacheGuard (see #224 pattern).
Auto-purge stored crash / problem reports older than **1 month** from the device, triggered **when the device connects to a charger**, so debug records don't accumulate indefinitely on-device.
## Trigger
Use a WorkManager job with a **charging constraint** (`setRequiresCharging(true)`) — battery-safe and consistent with the app's existing WorkManager scheduling (`SyncScheduler`, `PruneWorker`). Prefer this over a raw `ACTION_POWER_CONNECTED` `BroadcastReceiver` (can't be manifest-registered on modern Android and wakes the app unnecessarily). A periodic job that runs in a charging window, or a one-time job enqueued on charge, both work.
## Purge
- Delete stored reports with `createdAtMillis` older than 30 days (a `RETENTION` constant). The reports are **file-backed via `ReportStore`** (not Room — per the `ReportUploadWorker` path), so this is file cleanup, not a DB query.
- Age is the sole criterion per the request (purge submitted and unsubmitted alike once older than the cutoff).
## Notes
- Unit-test the cutoff (a 29-day-old report survives; a 31-day-old one is purged); make it idempotent.
- Schedule the worker at startup, mirroring `PruneWorker`/`BackfillWorker` via `SyncScheduler`. `ReportStore` is file-backed so it needs no DB access — but if any cache-DB dep sneaks in, gate it on `EncryptedCacheGuard` (see #224 pattern).
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.
Auto-purge stored crash / problem reports older than 1 month from the device, triggered when the device connects to a charger, so debug records don't accumulate indefinitely on-device.
Trigger
Use a WorkManager job with a charging constraint (
setRequiresCharging(true)) — battery-safe and consistent with the app's existing WorkManager scheduling (SyncScheduler,PruneWorker). Prefer this over a rawACTION_POWER_CONNECTEDBroadcastReceiver(can't be manifest-registered on modern Android and wakes the app unnecessarily). A periodic job that runs in a charging window, or a one-time job enqueued on charge, both work.Purge
createdAtMillisolder than 30 days (aRETENTIONconstant). The reports are file-backed viaReportStore(not Room — per theReportUploadWorkerpath), so this is file cleanup, not a DB query.Notes
PruneWorker/BackfillWorkerviaSyncScheduler.ReportStoreis file-backed so it needs no DB access — but if any cache-DB dep sneaks in, gate it onEncryptedCacheGuard(see #224 pattern).