{
  "id": 6049422,
  "title": "Five Code Paths Write the Same Subscription Row. On Purpose.",
  "url": "https://urgent.news/2026/09/06/five-code-paths-write-the-same-subscription-row-on-purpose",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-06T21:53:23.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/nabeelbaghoor/five-code-paths-write-the-same-subscription-row-on-purpose-25f7"
  },
  "original_language": "en",
  "account": "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.\n\nTo 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.",
  "summary": "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…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}