Skip to content

SMS workflow reminder retry count tracking#4

Open
ShashankFC wants to merge 1 commit into
sms-retry-basefrom
sms-retry-enhanced
Open

SMS workflow reminder retry count tracking#4
ShashankFC wants to merge 1 commit into
sms-retry-basefrom
sms-retry-enhanced

Conversation

@ShashankFC

@ShashankFC ShashankFC commented Jan 22, 2026

Copy link
Copy Markdown

Test 9nn

Summary by CodeRabbit

  • New Features

    • Implemented automatic retry capability for SMS reminders to handle delivery failures.
  • Bug Fixes

    • Improved error handling for failed SMS reminder deliveries with enhanced tracking and retry mechanisms.

✏️ Tip: You can customize this high-level summary in your review settings.

nn---n*Replicated from [ai-code-review-evaluation/cal.com-coderabbit#9](https://github.com/ai-code-review-evaluation/cal.com-coderabbit/pull/9)*

Note

Medium Risk
Touches production workflow scheduling logic and introduces new deletion criteria based on retryCount, which could prematurely drop reminders if thresholds or increments are incorrect.

Overview
Adds retryCount tracking to WorkflowReminder (Prisma schema + migration) to persist SMS scheduling failures.

Updates scheduleSMSReminders to (a) include retryCount when fetching unscheduled reminders, (b) increment retryCount when Twilio scheduling returns no sid or throws, and (c) delete reminders that are either past due SMS entries or have exceeded the retry threshold (retryCount > 1).

Written by Cursor Bugbot for commit 2dae0bf. Configure here.

* add retry count to workflow reminder

* add logic to for retry count

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
@ShashankFC

Copy link
Copy Markdown
Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

retryCount: {
gt: 1,
},
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unscoped retryCount deletion removes non-SMS workflow reminders

High Severity

The retryCount: { gt: 1 } condition in the OR clause of deleteMany is not scoped to SMS reminders. Since the OR makes each branch independent, this will delete any WorkflowReminder (EMAIL, WHATSAPP, etc.) that has retryCount > 1. The method: WorkflowMethods.SMS filter only applies to the first OR branch. This could cause email and WhatsApp reminders to be permanently deleted by the SMS cron job.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants