Skip to content
FeaturesPricingAffiliateBlogHelpAboutContact
Get StartedSign In
Back to Blog
industry2026-05-2312 min read

My monthly promo budget burned 44% over — one phone number redeemed the welcome discount 3 times (phone hash drift, max_uses_per_customer bypass)

Jakub (42) runs Pierogi & Vodka Bar in Krakow Kazimierz with a monthly "Welcome 15% off" promo and `max_uses_per_customer = 1`. May end-of-month dashboard: 320 PLN burned, expected ~220 PLN. 44% overspend. Redemption log shows one phone number — `+48 504 123 456` — redeemed three times. thMenu support pulled 3 separate phone_hash rows in D1. Forensic: customer entered the system through THREE distinct signup routes during the month — May 4 loyalty signup via `/api/loyalty`, May 14 reservation via `/api/reservations`, May 21 waitlist via `/api/waitlist`. All three routes used inline `body.phone?.replace(/[s-().]/g, "")` — the canonical `normalisePhone()` helper landed in PR #544 OO but those three sibling routes were missed in that sweep. Each route's historical normalization sequence wrote a different phone_hash to D1. Cap-check `WHERE phone_hash = ? AND code = ?` saw "0 prior redemptions" three times → cap bypass. **PR #661 batch XI F1** fix: all three routes now `import { normalisePhone }` and route through the helper — future updates (bidi-strip, plus-prefix normalize, leading-zero coerce) propagate to all 5 routes from one source. Pattern: when a canonical helper module ships, the SAME PR must grep + migrate every inline duplicate — drift is inevitable if the sweep is deferred.

th

thMenu Team

thmenu.com

Found this helpful? Share it.