Fixed

Subscriptions created at checkout are no longer silently lost

Billing & Payments

A race condition at Shopify checkout could cause a new Subi subscription to be silently dropped — the customer completed payment, but Subi never created their subscription contract.

What was happening

When a customer subscribes at checkout, Shopify sends two near-simultaneous webhooks to Subi: one to register the customer's payment method and one to create the subscription contract. These two tasks race to insert the same payment method record. Whichever task lost that race failed immediately and was not retried — because the webhook had already been acknowledged to Shopify, Celery had no mechanism to retry it. When the contract creation task was the loser, the subscription was never persisted: 134 affected contracts were confirmed in production error logs, at a rate of roughly 2–5 per day.

The error was silent from the merchant's side — no failed order, no error notification — so affected merchants could not identify the issue without a support investigation.

What changed

Both tasks now catch the duplicate-insert signal, log a warning, and retry the persist once. On the second pass, the already-existing payment method row resolves correctly and the subscription contract is created. The fix mirrors an identical race-handling pattern already in place for order sync. The first insert attempt runs inside an atomic transaction so a partially poisoned transaction cannot break the retry.

A separate backfill was run for the 134 contracts confirmed lost before the fix reached production. No action is needed from merchants.

Beyond Subscriptions

Launch and scale recurring revenue on Shopify in days, not months.

Book Demo