ops: sweep expired confirmations, authorization codes, and invites #160

Closed
opened 2026-08-09 18:23:01 +00:00 by rosa · 0 comments
Owner

Found during an operational-resilience review (Release It! stability rules).

Location: crates/infra/src/repositories/sqlite.rs:677,690 (confirmations), :1289 (authorization_codes), :1107 (invites)
Severity: Medium — unbounded growth (Steady State)

Problem

Confirmations, authorization codes, and invites are deleted only when they are consumed (keyed by identifier). An expired-but-never-redeemed row is never swept, so these capability tables accumulate dead rows indefinitely. Lower volume than sessions, but the same Steady-State violation: something accumulates with no matching reclamation.

Suggested fix

Add a periodic sweep — DELETE ... WHERE expires_at < now for each of the three tables — ideally running on the same scheduled reaper introduced for session cleanup (#159).

Found during an operational-resilience review (Release It! stability rules). **Location:** `crates/infra/src/repositories/sqlite.rs:677,690` (confirmations), `:1289` (authorization_codes), `:1107` (invites) **Severity:** Medium — unbounded growth (Steady State) ## Problem Confirmations, authorization codes, and invites are deleted only when they are **consumed** (keyed by `identifier`). An expired-but-never-redeemed row is never swept, so these capability tables accumulate dead rows indefinitely. Lower volume than sessions, but the same Steady-State violation: something accumulates with no matching reclamation. ## Suggested fix Add a periodic sweep — `DELETE ... WHERE expires_at < now` for each of the three tables — ideally running on the same scheduled reaper introduced for session cleanup (#159).
rosa closed this issue 2026-08-10 02:50:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rosa/vernier#160
No description provided.