Lopsided Alerts Had No State (#200)
Users told us they were getting the same "Lopsided pricing detected" alert over and over, by email and by text. The audit was worse than the reports: one recipient received 420 identical emails in 7 days, another 177 in 2 days, and because that second user had Interior, Oceanview, and Balcony subscriptions on the same sailing, each email carried the identical line three times. The heaviest recipient was also burning through the 20-a-day SMS budget on it.
The cause was simple. Availability and price-change alerts compare against the last known state and fire on a transition. The lopsided checks (a lower-tier cabin pricing above a higher one) compared nothing; they fired on every 15-minute pass while the condition held.
The fix gives them the same memory the other checks have:
- Each subscription now remembers whether the sailing was lopsided last time and by how much. The first pass baselines silently, so nobody got a fresh wave on deploy.
- An alert fires only on the not-lopsided to lopsided transition.
- It re-fires only if the per-person gap narrows by $25 or more, and then the message says what the gap was and what it is now.
- The same finding is deduped across a user's subscriptions on one sailing and guest count, so no more triple lines.
First pass after deploy baselined 82 of 85 lopsided subscriptions (7 currently lopsided) and sent zero emails. Every prior pass that day had sent two or three.