fix(reliability): suppress redelivery of already-processed webhook events (#789) - #818
Conversation
…ents On success the queue overwrites a webhook event's payloadHash with a "processed" sentinel, so a GitHub redelivery (same delivery id, real payload hash) failed the hash-only dedup and reprocessed the event — re-firing its side effects. Gate/check ops are idempotent (PATCH), but recordGithubProductUsage and audit events double-counted and the advisory re-posted. Dedup now also suppresses any non-"error" event already in the "processed" state, while still letting "error" rows through so a failed enqueue/processing can retry. Closes #789
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
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 #818 +/- ##
=======================================
Coverage 96.77% 96.77%
=======================================
Files 97 97
Lines 14000 14000
Branches 5098 5098
=======================================
Hits 13548 13548
Misses 86 86
Partials 366 366 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
gittensory · advisory review Reviewed 2 changed file(s) — two independent AI reviewers. Changed files: Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Worth double-checking
|
On success the queue overwrites a webhook event's
payloadHashwith aprocessedsentinel, so a GitHub redelivery (same delivery id, real payload hash) failed the hash-only dedup at webhook.ts:40 and reprocessed — re-firing side effects. Gate/check ops are idempotent (PATCH), butrecordGithubProductUsageand audit events double-counted and the advisory re-posted.Fix: dedup now also suppresses any non-
errorevent already in theprocessedstate, while still lettingerrorrows through so a failed enqueue/processing can retry. Surgical: 1 source file, 5 lines.Test: seeds a
processedevent, then redelivers with the real payload → asserts202 duplicateand thatJOBS.sendis not called. 3 webhook tests pass; changed lines covered.Closes #789