fix(db): retain notification_deliveries on the same 90d schedule as webhook_events - #8941
Conversation
…ebhook_events notification_deliveries is an append-only delivery log with created_at and an index ready for pruning, but it was missing from RETENTION_POLICY so rows accumulated forever. Add the 90-day rule and cover prune behavior. Closes JSONbored#8899
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8941 +/- ##
==========================================
+ Coverage 90.56% 90.58% +0.02%
==========================================
Files 96 97 +1
Lines 22490 22547 +57
Branches 3884 3904 +20
==========================================
+ Hits 20367 20424 +57
Misses 1945 1945
Partials 178 178
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 14:19:15 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
{ table: "notification_deliveries", column: "created_at", days: 90 }toRETENTION_POLICY, matching the append-only siblingwebhook_events.?cutoff binds inpruneExpiredRecordsso node:sqlite tests (and D1) bind reliably.notification_deliveriesrows and keeps recent ones.Closes #8899
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpx vitest run test/unit/retention.test.ts -t "notification_deliveries|webhook_events older|policy only targets"(3 passed)npx vitest run test/unit/selfhost-pg-retention.test.ts -t "translates the numbered"(1 passed — cutoff still becomes$1)If any required check was skipped, explain why:
Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
N/A — DB retention policy only; no UI surface change.
Notes