Reliable HTTP cron and delayed-job scheduling with automatic retries and full run logs — delay.run
This is a hypothetical case study. The product, the numbers and the timeline are invented; the bug is one of the most common ones in subscription billing.
The setup
A small SaaS app sells a Pro plan through a payment provider's hosted checkout. The integration was built the way many tutorials show:
The user clicks "Upgrade", and the backend creates a checkout session.
The user pays on the provider's page and is sent back to the app.
The provider sends webhooks. The app's handler listens for subscription events and sets the account's plan from the subscription status in the payload.
The handler was short:
app . post ( "/webhooks/billing" , verifySignature , async ( req , res ) => { const event = req . body ; if ( event . type . startsWith ( "customer.subscription." ) ) { const sub = event . data . object ; const plan = sub . status === "active" || sub . status === "trialing" ? "pro" : "free" ; await db .…