Amazon Ergo 1.0 · Balanced
sms-workflow-reminder-retry-count-tracking-cal-com
cal.com · TypeScript · S · 30–99 lines · 3 files
The normal review, with one generalist agent. Judge: Claude Opus 5.5.
- Gold bugs found
- 2 of 6
- Comments published
- 2
- Comments matching a bug
- 2
- Comments not matching
- 0
- Cost of this PR
- $0.795
Published comments (2)
Lock-skipped SMS reminders are counted as failures and deleted — Lock-based skips now increment `retryCount`, so the `retryCount > 1` `deleteMany` deletes reminders after two cron runs instead of leaving them queued for delivery after an admin lifts the SMS lock. Count only delivery failures from the catch path; `scheduleSMS` in twilioProvider.ts returns `undefined` without sending when locked.
Retry-count update in catch can abort remaining SMS reminders — If `prisma.workflowReminder.update` throws (for example, Prisma `P2025` after a concurrent delete), the exception escapes the catch and aborts the handler, skipping every remaining reminder. Wrap this bookkeeping update in its own try/catch or use a non-throwing update so one stale reminder cannot stop the batch.