Building dual-platform SaaS on nights and weekends. No fluff, just code, Stripe nightmares, and the reality of shipping
I'm Usama, a PM and solo dev building EpicNotes (a native KMP app for the Android+Mac combo). I write about the unglamorous side of shipping: wiring webhooks at 2 AM, fighting app store compliance, and the code that actually survives.
Markdown supported · ⌘↵ to post
The one that catches most people: test mode never shows you a renewal failing a month later. In production, a chunk of failed renewals are temporary declines that a later retry recovers, and the rest need the customer to update their card. Neither shows up until you've had real subscribers for a few billing cycles.
The zombie Pro user case is a great example of why out-of-order webhooks bite. Fetching the live subscription state by subscription_id instead of trusting the payload is a clean fix. The $2 real purchase and refund test is cheap insurance too. Congrats on launching EpicNotes.
The zombie-user bug is a great catch. Trusting webhook order feels reasonable right up until a retry lands late, and re-fetching the live subscription by ID is the kind of fix that’s only obvious after you’ve been burned. I’m a solo dev on Supabase too and haven’t wired payments into my product yet, so this goes straight into my notes. Did you also store processed event IDs to skip duplicates, or was the re-fetch enough on its own?
Naval Pro
You asked about a handler skeleton and whether to store processed event ids. Yes, store them. Here's the shape I use:
Check the signature on the raw body, before you parse anything. Insert the event id into a table with a unique constraint. If the insert fails, you've seen it before, so return 200 and stop. Fetch the subscription from Stripe and write that, not the event payload. Add a revision column and update with WHERE revision = , so two handlers running at once can't overwrite each other. Return 200.
Re-fetching fixes the stale state, but it won't stop a retry from sending the same email twice. The event id table is what stops that. I put a tested version of this together for Postgres/Supabase. It's on my GitHub (navalpro8-lgtm, repo stripe-subscription-sync). It's mine, and not audited, so treat it as a reference. i couldnt paste the link so try going to my repo manually