- Shipped
- September 6, 2026 at 2:58 AM UTC
- Author
- Kamo
- Commit
- b8da809
**************** was the ONLY thing in the fleet that ever inserted into MARKETING_VISITORS, so the whole conversion pipeline silently depended on a browser beacon having arrived first. Every stamp here is a conditional UPDATE: with no row, markSignedUp matched nothing, logged at debug and returned — and markOrgCreated and markPaid then did the same forever after, because they key off the same row. Nothing repaired it; the nightly reconcile only recomputes counters for rows that already exist. That beacon is best-effort by construction — deferred, cancellable, dependent on hydration, and never sent from the register site at all. The visitor it lost most reliably was the best one: somebody who followed a partner link and clicked the CTA immediately. The faster they converted, the more certainly the member who sent them earned nothing. The signup envelope is durable by comparison — published after commit, redelivered until acked — and when it names a live code it carries everything the row needs. So when the stamp matches nothing and the code resolves, the row is created from the signup and stamped. It cannot double-count or move credit: insertIfAbsent is ON CONFLICT DO NOTHING, so a 0 means the row already existed and the callers 0-row stamp was a genuine replay, which is left alone. Only an actual insert proceeds, and a row that did not exist a statement ago cannot have been counted anywhere. The pair row and its bumpUniqueVisitor are gated on that same row count, so the code does not end up reporting a signup against zero unique visitors — which the nightly reconcile would then faithfully keep. The row is deliberately sparse: geo, browser and referrer are answers about a page view that did not happen, and filling them from the conversion would invent data. MarketingSignupBackstopTest covers the rescue, the replay, a retired code, a codeless envelope and the ordinary beaconed path. Verified red-green: with the backstop disabled only the rescue test fails.