Archive writer lifecycle: evict writers on webhook deletion and sweep idle archives #89

Open
opened 2026-08-07 19:11:43 +02:00 by clawbot · 0 comments
Collaborator

Tracking issue for two non-blocking findings carried through the PR #84 (issue #43) review rounds, so they stop being untracked.

Problems

  1. The per-webhook archiveWriter registry (writers map in internal/delivery) is never evicted when a webhook is deleted: the writer (and any open archive DB handle within its debounce window) lingers for the process lifetime.
  2. Expiry pruning runs only on archive (re)open, and reopens happen only on writes — an archive for a webhook that stops receiving events is never swept, so expired rows persist indefinitely.

Definition of done

  • Deleting a webhook closes and removes its archiveWriter from the registry (and the reaper/deletion path is covered by a test).
  • Idle archives with a configured expiry get pruned without requiring a new write (periodic sweep, or prune scheduled off the debounce timer) — with a test proving rows older than expiry disappear from an idle archive.
  • No behavior change for archives with expiry "never".
Tracking issue for two non-blocking findings carried through the PR #84 (issue #43) review rounds, so they stop being untracked. ## Problems 1. The per-webhook `archiveWriter` registry (`writers` map in `internal/delivery`) is never evicted when a webhook is deleted: the writer (and any open archive DB handle within its debounce window) lingers for the process lifetime. 2. Expiry pruning runs only on archive (re)open, and reopens happen only on writes — an archive for a webhook that stops receiving events is never swept, so expired rows persist indefinitely. ## Definition of done - Deleting a webhook closes and removes its `archiveWriter` from the registry (and the reaper/deletion path is covered by a test). - Idle archives with a configured expiry get pruned without requiring a new write (periodic sweep, or prune scheduled off the debounce timer) — with a test proving rows older than expiry disappear from an idle archive. - No behavior change for archives with expiry "never".
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#89