Act I · Bug Fix
The Cancel-at Mending
Whats the url on vercel for that db can i view the data there?
Bug Fixed
Stripe portal cancellations set cancel_at (a timestamp) instead of cancel_at_period_end (a boolean). The membership route backfill only checked the boolean, so cancellation state never appeared on the frontend Settings page.
Aligned all three Stripe subscription handlers to check both cancel_at_period_end and cancel_at !== null. When cancel_at is present, it takes priority as the currentPeriodEnd date — this is the actual cancellation timestamp the portal writes.
Three locations made consistent: webhook.ts buildEntitlementFromSubscription, webhook/route.ts handleSubscriptionUpdated, and membership/route.ts backfill path.
// Before: only checked the boolean cancelAtPeriodEnd = sub.cancel_at_period_end;// After: portal uses cancel_at timestamp cancelAtPeriodEnd = sub.cancel_at_period_end || sub.cancel_at !== null; currentPeriodEnd = sub.cancel_at ? new Date(sub.cancel_at * 1000).toISOString() : sub.items.data[0] ? new Date(sub.items.data[0].current_period_end * 1000).toISOString() : new Date().toISOString();