Split from the payment reliability review around #4765.
Problem
Dodo webhook processing is intentionally fail-fast for malformed subscription events so the provider retries. That is better than silently dropping a bad event, but there is still no durable local dead-letter / incident surface when retries are exhausted or a permanent schema mismatch keeps failing.
Current risk:
- A bad subscription/payment webhook can fail repeatedly and exhaust provider retries.
- The missing event can leave subscription, payment, or entitlement state stale.
- Operators have to infer the failure from logs/Sentry/provider dashboard rather than a first-class local record.
This is especially important for renewal events because a missed subscription.renewed can effectively downgrade a paying subscriber once local validUntil expires.
Proposed work
Add durable webhook failure tracking for Dodo payment/subscription events.
Suggested shape:
- Create a
paymentWebhookFailures / billingIncidents table keyed by webhookId, eventType, and, when available, subscription_id / payment_id.
- On processing failure, persist sanitized failure metadata: error kind, message, data keys, event timestamp, receivedAt, retry count/lastSeenAt if repeated.
- Do not store full sensitive payloads unless explicitly sanitized.
- Emit Sentry/ops alerts when failures are new, repeated, or older than an SLA.
- Provide an internal action/mutation to mark incidents resolved after manual repair or reconciliation.
- Add a health/diagnostic query so on-call can see unresolved payment webhook failures.
Acceptance criteria
Related
Priority: P2. This is an observability and repairability layer for the payment pipeline; it turns silent webhook exhaustion into an actionable queue.
Split from the payment reliability review around #4765.
Problem
Dodo webhook processing is intentionally fail-fast for malformed subscription events so the provider retries. That is better than silently dropping a bad event, but there is still no durable local dead-letter / incident surface when retries are exhausted or a permanent schema mismatch keeps failing.
Current risk:
This is especially important for renewal events because a missed
subscription.renewedcan effectively downgrade a paying subscriber once localvalidUntilexpires.Proposed work
Add durable webhook failure tracking for Dodo payment/subscription events.
Suggested shape:
paymentWebhookFailures/billingIncidentstable keyed bywebhookId,eventType, and, when available,subscription_id/payment_id.Acceptance criteria
Related
Priority: P2. This is an observability and repairability layer for the payment pipeline; it turns silent webhook exhaustion into an actionable queue.