Kimi K3.1 Pro · 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
- 3 of 5
- Comments published
- 4
- Comments matching a bug
- 3
- Comments not matching
- 1
- Cost of this PR
- $0.989
Published comments (4)
Retry cleanup deletes non-SMS reminders before their scheduled date — Future-dated EMAIL and WHATSAPP reminders can be permanently removed by the SMS cron. Apply `method: WorkflowMethods.SMS` to both `OR` branches so the `retryCount > 1` cleanup cannot match other delivery methods.
SMS reminders without recipients never increment retryCount — When `smsReminderNumber = null`, an `SMS_ATTENDEE` reminder skips the `message && sendTo` branch, leaving `retryCount` at 0 and causing reprocessing until its scheduled date. Increment `retryCount` on the no-recipient path so undeliverable reminders can be retired.
Concurrent SMS failures can undercount retries and exceed the retry limit — Concurrent scheduler runs can record several failed attempts as one, letting delivery attempts continue beyond the retry limit. Replace `reminder.retryCount + 1` with an atomic database increment in both failure paths instead of using the stale `findMany` snapshot.
Retry-count update failures can abort SMS reminder processing — A failure from `prisma.workflowReminder.update` inside the error handler escapes and skips the remaining `unscheduledReminders`, whether the row was removed by cleanup or the update otherwise failed. Catch persistence errors separately and tolerate missing rows so the original scheduling error cannot abort the run.