Skip to content

Conversation

@akshayutture-augment
Copy link

* add retry count to workflow reminder

* add logic to for retry count

---------

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 28 to 44
//delete all scheduled sms reminders where scheduled date is past current date
await prisma.workflowReminder.deleteMany({
where: {
method: WorkflowMethods.SMS,
scheduledDate: {
lte: dayjs().toISOString(),
},
OR: [
{
method: WorkflowMethods.SMS,
scheduledDate: {
lte: dayjs().toISOString(),
},
},
{
retryCount: {
gt: 1,
},
},
],
},

Choose a reason for hiding this comment

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

P1 Badge Stop deleting reminders after two retries

The cleanup query now deletes any WorkflowReminder whose retryCount is greater than 1 (lines 28‑44). Because the new logic increments retryCount every time scheduling fails or throws (lines 179‑196), a reminder that experiences two transient Twilio errors will be removed the next time the cron runs instead of being retried again. Before this change those reminders kept being retried until Twilio accepted the schedule; now they silently disappear and the attendee never receives the SMS. If the intent was only to track retries, the retryCount check needs to be removed or replaced with explicit cancellation logic instead of unconditional deletion.

Useful? React with 👍 / 👎.

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.

3 participants