mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 03:15:01 +00:00
One Checkout sends checkout.session.completed, customer.subscription.created and invoice.paid, often concurrently; each that re-read the row before another wrote it saw the plan start and pushed billing.plan_started with its own 'at', so the event ids differed and the team's audit log showed it twice. A plan starting or ending now carries a once key (subscription id and period start), so every racer pushes the same event id and the control plane's INSERT OR IGNORE keeps one.