GLM-5.3 Flash · 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 Opus 5.5.
- Gold bugs found
- 2 of 6
- Comments published
- 3
- Comments matching a bug
- 2
- Comments not matching
- 1
- Cost of this PR
- $0.086
Published comments (3)
Unindexed retryCount disjunct forces full scan of WorkflowReminder on every cron run — The OR branch filters on `retryCount`, which has no index on `WorkflowReminder`, so every cron run degrades to a full scan instead of using the `method`/`scheduledDate` composite index. Add an index on `retryCount` or scope the branch with the same `method` filter.
Non-atomic retryCount increment loses updates across overlapping cron runs — Overlapping cron runs read the same `retryCount` snapshot and both write value+1, losing increments, so a repeatedly failing reminder can stay below the cleanup threshold and retry forever. Use an atomic `retryCount: { increment: 1 }` in the update data.
Catch-block retryCount update can throw and abort remaining reminders — The update inside the catch can itself throw — e.g. `P2025` when a reminder was concurrently deleted — aborting the loop so remaining reminders are skipped and the cron request fails. Wrap it in its own try/catch or use `updateMany`, which doesn't throw on missing rows.