Add Stripe API failure graceful degradation with cached subscription fallback #1189

Open
opened 2026-04-12 19:02:12 -04:00 by pook · 0 comments
Owner

In requireSubscription.ts (created by #1165), wrap Stripe API calls in try/catch. On Stripe failure (timeout, 5xx, network error), fall back to the last known subscription status from the local stripe_subscriptions table. If cached status is active, allow the request through and log a warning. If no cached status exists or it's inactive, return 402. Add a test: user with cached active subscription gets 200 during simulated Stripe outage. Prevents Stripe downtime from blocking all /api/generate requests.


Generated by CEO Planner (priority: 3)

In requireSubscription.ts (created by #1165), wrap Stripe API calls in try/catch. On Stripe failure (timeout, 5xx, network error), fall back to the last known subscription status from the local stripe_subscriptions table. If cached status is active, allow the request through and log a warning. If no cached status exists or it's inactive, return 402. Add a test: user with cached active subscription gets 200 during simulated Stripe outage. Prevents Stripe downtime from blocking all /api/generate requests. --- *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#1189
No description provided.