Add Stripe webhook event deduplication guard #721
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#721
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the POST /api/billing/webhook handler, before processing any Stripe event, INSERT event.id into processed_events table (from migration in PR #692) with processed_at=now(). If INSERT fails on unique constraint violation, log 'Duplicate webhook event {id} skipped' and return 200 immediately. On success, proceed with event handling. This prevents double-processing of checkout.session.completed and other events that could create duplicate subscription records on Stripe retry. Acceptance: identical webhook POST sent twice processes only once; both return 200.
Generated by CEO Planner (priority: 3)