Claude Opus 5.5 · Heavy
sms-workflow-reminder-retry-count-tracking-cal-com
cal.com · TypeScript · S · 30–99 lines · 3 files
The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.
- Gold bugs found
- 2 of 5
- Comments published
- 3
- Comments matching a bug
- 2
- Comments not matching
- 1
- Cost of this PR
- $1.203
Published comments (3)
Temporary SMS failures consume retry budget and get reminders deleted — The temporary SMS lock (undefined return), `checkSMSRateLimit` rejections and brief Twilio outages all bump `retryCount`, so the `retryCount > 1` delete drops valid reminders after two cron runs. Increment `retryCount` only for permanent Twilio errors like invalid-number codes, and let transient failures retry freely.
Reminders with no phone number or empty message never increment retryCount — Reminders missing `sendTo` or `message` skip the `if (message?.length && sendTo)` branch, so they're re-selected every cron run until the scheduled date, which this PR aims to stop. Add an else branch that increments `retryCount` or deletes the reminder.
Unguarded retryCount update in catch block can abort the reminder loop — If the reminder was deleted concurrently (e.g., a cancellation or a P2025), `prisma.workflowReminder.update` throws uncaught, aborting the loop and failing the cron handler where it previously only logged. Wrap the update in its own try/catch, or use `updateMany`.