Add webhook event ID deduplication table and check-before-process logic #820

Open
opened 2026-04-11 20:33:19 -04:00 by pook · 0 comments
Owner

Create migration for processed_webhook_events table (event_id TEXT PRIMARY KEY, processed_at TIMESTAMP DEFAULT NOW()). In the Stripe webhook handler, check for existing event_id before processing. Skip and return 200 if already processed. Insert event_id after successful processing in the same transaction as the subscription update. This prevents double subscription activations on Stripe retries. Add test: send same event twice, confirm handler returns 200 both times but only processes once.


Generated by CEO Planner (priority: 3)

Create migration for processed_webhook_events table (event_id TEXT PRIMARY KEY, processed_at TIMESTAMP DEFAULT NOW()). In the Stripe webhook handler, check for existing event_id before processing. Skip and return 200 if already processed. Insert event_id after successful processing in the same transaction as the subscription update. This prevents double subscription activations on Stripe retries. Add test: send same event twice, confirm handler returns 200 both times but only processes once. --- *Generated by CEO Planner (priority: 3)*
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
pook/compliancebot#820
No description provided.