📖 Originally published on meridianbuild.dev my engineering blog documenting the real bugs and decisions behind OutfitMaker.
I opened the subscriptions table on OutfitMaker one evening and felt my stomach drop. A pile of rows sitting at status: incomplete, no billing period, no active subscription. To a founder's eye that reads as one thing: failed payments. People tried to pay me and something broke. My webhook must be dropping events. I'm losing money and I don't even know how much.
I spent the first ten minutes composing the incident in my head which Stripe webhook, which signature check, how far back does it go. Then I did the one thing that turned a panic into a five-line cleanup: I checked the source of truth before I touched anything.
The rows were real. The failures were not.
Here's what those incomplete rows actually were. When a user clicks "subscribe," SubscriptionsController#find_or_create_stripe_customer inserts a local Subscription row immediately before
Discussion
Get the discussion rolling
A single comment can start something great.