Urgent.News

What's breaking now, across thousands of outlets.

Tech

Five Code Paths Write the Same Subscription Row. On Purpose.

I run a small SaaS called VoiceDash . It gives voice AI agencies a white label portal they can hand to their own clients. Next.js on Vercel, Postgres behind Prisma, Stripe for billing. The first version of the billing code had exactly one place that wrote subscription state: the Stripe webhook. That is what every tutorial shows you. It is also the version that locked a paying customer out of the…

VoiceDash, a small SaaS platform providing voice AI agencies with a white label portal, experienced a bug in their billing code. The bug occurred when an agency owner selected a plan and paid, but was then redirected back into the product without a subscription row. This happened because the subscription state was being treated as living in the database, not as being sourced from Stripe.

To resolve the issue, the developer added five distinct code paths to write the same subscription row, each handling different scenarios such as Stripe webhook events, customer returns, client-side verification, plan changes, and read-time reconciliation. All five paths ultimately call the same function to upsert the subscription row in the database, ensuring idempotency and making the last write the correct one.

By treating the subscription state as a cache that needs to be constantly refreshed, the developer made the system more resilient and avoided potential data corruption issues.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Karibu Give; USSD Micro-Philanthropy for the Next Billion Givers

This is a submission for Weekend Challenge: Generosity Edition What I Built Karibu Give (Swahili for Welcome, Give ) is a USSD micro-donation platform that works on a kabambe phone(feature phone) with…

  • Karibu Give enables USSD micro-donations via feature phones
  • Users donate via 3846120# to selected causes
  • Platform provides AI impact summaries for donors and managers

Charity money follows the news cycle. I built a Blink that splits it evenly instead

This is a submission for Weekend Challenge: Generosity Edition What I Built Generosity has a concentration problem. When a disaster happens, attention collapses onto whichever organisation is most…

  • OneClickGood Solana Blink splits donations evenly among three disaster-relief organizations
  • Streamlines process with single click, avoiding manual splitting across multiple websites
  • SPL Memo records intended split on ledger for donation audit and transparency

More from Sunday 6 September →