SMS sent within 60 seconds of booking confirmation if SMS is enabled
Why it matters
An SMS confirmation sent 10 minutes after booking is effectively useless — customers check their phone immediately after completing a transaction to verify it went through. A cron job polling every 5 minutes introduces an average 2.5-minute delay and a maximum 5-minute delay, which is long enough for customers to attempt a duplicate booking or contact support. CWE-391 and ISO 25010 reliability.fault-tolerance flag the missing retry path: a single synchronous SMS send with no retry means a carrier timeout silently voids the only channel some customers monitor. Event-driven dispatch removes the timing gap and the retry gap in one change.
Severity rationale
High because a polling-based or retry-less SMS confirmation produces delayed or silently dropped messages, undermining customer trust at the highest-anxiety moment in the booking flow.
Remediation
Queue the SMS in the same confirmBooking() function as the status write, after checking opt-out status. Use the same job queue and retry settings as confirmation email:
// src/lib/bookings.ts
async function confirmBooking(bookingId: string) {
const booking = await db.bookings.update(bookingId, { status: 'confirmed' })
if (booking.customer_phone) {
const isOptedOut = await checkOptOut(booking.customer_phone)
if (!isOptedOut) {
await smsQueue.add(
'send-confirmation-sms',
{ bookingId, phoneNumber: booking.customer_phone },
{ attempts: 5, backoff: { type: 'exponential', delay: 2000 } }
)
}
}
}
Remove any cron or polling job that handles SMS confirmation — the queue is the only dispatch path.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Booking Notifications & Reminders Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-391 — Unchecked Error Condition
- iso-25010:2011 · reliability.fault-tolerance
Taxons
History
- 2026-04-18·v1.0.0·Initial import from booking-notifications-reminders·automated