---
title: "Comment by Mohan on \"Why Stripe Test Mode Lies: A Solo Dev's 36-Hour Payment Infrastructure Trench Warfare\" | Hashnode"
description: "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"
url: "https://hashnode.com/posts/why-stripe-test-mode-lies-a-solo-dev-s-36-hour-payment-infrastructure-trench-warfare/6accab3a2cf2ed754311386a/comment/6ace1152f4ebcd481f9cbcb9"
---

[Discussion](https://hashnode.com/posts/why-stripe-test-mode-lies-a-solo-dev-s-36-hour-payment-infrastructure-trench-warfare/6accab3a2cf2ed754311386a)

Comment [Why Stripe Test Mode Lies: A Solo Dev's 36-Hour Payment Infrastructure Trench Warfare](https://hashnode.com/posts/why-stripe-test-mode-lies-a-solo-dev-s-36-hour-payment-infrastructure-trench-warfare/6accab3a2cf2ed754311386a)

[Mohan](https://hashnode.com/@resumeorbitz)

[Oct 13](https://hashnode.com/posts/why-stripe-test-mode-lies-a-solo-dev-s-36-hour-payment-infrastructure-trench-warfare/6accab3a2cf2ed754311386a/comment/6ace1152f4ebcd481f9cbcb9)

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?

[Epic Devs](https://hashnode.com/@epicdevs)

[Oct 13](https://hashnode.com/posts/why-stripe-test-mode-lies-a-solo-dev-s-36-hour-payment-infrastructure-trench-warfare/6accab3a2cf2ed754311386a/comment/6ace1152f4ebcd481f9cbcb9#reply-6ace11ef342d15a038821ba4)

Thank you! And honestly — re-fetch alone WAS enough for _state_ correctness, and that's the part I'd emphasize to anyone pre-payments: if every handler re-fetches live state by subscription ID instead of trusting the payload, processing becomes convergent. A duplicate event just re-fetches the same truth and writes the same row. Duplicates become harmless no-ops against the DB.

Where it still bites is side effects. The DB converges, but nothing stops a duplicate from re-sending the "Welcome to Pro" email, double-logging an upgrade analytics event, or burning a redundant Stripe API call. So no — I didn't originally store event IDs, and I learned the hard way that state idempotency ≠ side-effect idempotency.

What's on the backlog now: a small processed\_events table (event\_id PK, type, created\_at, processed\_at). Handler checks it first and returns 200 early on duplicates, plus an ordering guard — only apply if event.created is newer than the last applied timestamp for that subscription, so a stale retry can't overwrite fresher state under concurrent delivery.

Since you're pre-payments on Supabase, the combo I'd wire from day one: (1) verify signatures, (2) re-fetch live state, (3) event-ID store for side effects. It's maybe 30 lines of Edge Function and it deletes an entire class of 2 AM bugs. Happy to share my handler skeleton if it's useful — good luck with the wiring, it's about to get interesting!

[Mohan](https://hashnode.com/@resumeorbitz)

[Oct 14](https://hashnode.com/posts/why-stripe-test-mode-lies-a-solo-dev-s-36-hour-payment-infrastructure-trench-warfare/6accab3a2cf2ed754311386a/comment/6ace1152f4ebcd481f9cbcb9#reply-6acf8cf354e3a146575d578f)

"State idempotency != side-effect idempotency" is the line I needed. I'd have assumed the re-fetch covered everything and then wondered why someone got two welcome emails. The ordering guard on event.created is a nice touch too. And yes, I'd love the handler skeleton. Signatures, re-fetch, event-ID store from day one is going straight into my Supabase Edge Function plan. Thanks for writing it all out!

[Mohan](https://hashnode.com/@resumeorbitz)

[Oct 22](https://hashnode.com/posts/why-stripe-test-mode-lies-a-solo-dev-s-36-hour-payment-infrastructure-trench-warfare/6accab3a2cf2ed754311386a/comment/6ace1152f4ebcd481f9cbcb9#reply-6ada4fb1106819373ed5278e)

Hey Usama, just circling back on the handler skeleton. Still keen to see it whenever you get a minute, no rush. And congrats on getting EpicNotes live!
