Stripe webhook returned 200 but showed wrong subscription status due to field misread
A developer running a small subscription SaaS built on Next.js, Drizzle, and Postgres discovered a silent bug after canceling their own subscription in production. Despite Stripe correctly marking the subscription as canceled and both webhook deliveries returning HTTP 200 with no errors, the customer-facing dashboard continued to display 'Renews' instead of 'Cancels'. The developer's webhook handler was already re-fetching live subscription data from Stripe on every event, ruling out the initial theory of a race condition caused by out-of-order webhook delivery. Investigation revealed the root cause was a misread of Stripe's cancel_at_period_end field, which remained false even after cancellation under certain conditions. The incident prompted the developer to establish stricter habits around reading and validating fields from third-party payment provider APIs.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in