Write apps/backend/docs/concepts-gc-jobs.md covering every scheduled cleanup: services/deviceGc.ts, services/envelopeGc.ts, services/fileCleanup.ts, the prekey/key-package pruning, and the push-subscription backoff re-enable pass.
Acceptance criteria:
- Each job documented with schedule, what it removes, its retention window, and the env var that configures it
- Explains the idempotency and retry-safety of each — notably that a file's
hardDeletedAt is set only after a successful object-store delete, so a crash between the two is safe to retry
- Documents the reference-counting check that stops a still-referenced file being deleted
- States which jobs run in-process on every gateway node and the implications for a multi-node deployment
Write
apps/backend/docs/concepts-gc-jobs.mdcovering every scheduled cleanup:services/deviceGc.ts,services/envelopeGc.ts,services/fileCleanup.ts, the prekey/key-package pruning, and the push-subscription backoff re-enable pass.Acceptance criteria:
hardDeletedAtis set only after a successful object-store delete, so a crash between the two is safe to retry