Comprehensive workflow reminder management for booking lifecycle events#5
Comprehensive workflow reminder management for booking lifecycle events#5ShashankFC wants to merge 1 commit into
Conversation
…re still sent (#7232) * small UI fix * fix cancelling scheduled emails * improve comments * delete reminders for rescheduled bookings * add migration file * cancel rescheduled bookings immediately * remove immediate delete for request reschedule --------- Co-authored-by: CarinaWolli <wollencarina@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ebfcf448c
ℹ️ 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".
| booking.workflowReminders.forEach((reminder) => { | ||
| if (reminder.scheduled && reminder.referenceId) { | ||
| if (reminder.method === WorkflowMethods.EMAIL) { | ||
| deleteScheduledEmailReminder(reminder.referenceId); | ||
| } else if (reminder.method === WorkflowMethods.SMS) { | ||
| deleteScheduledSMSReminder(reminder.referenceId); | ||
| } | ||
| if (reminder.method === WorkflowMethods.EMAIL) { | ||
| deleteScheduledEmailReminder(reminder.id, reminder.referenceId); | ||
| } else if (reminder.method === WorkflowMethods.SMS) { | ||
| deleteScheduledSMSReminder(reminder.id, reminder.referenceId); |
There was a problem hiding this comment.
Await reminder cancellations before returning
These calls return promises that perform Prisma updates and external cancellations, but they are no longer awaited or included in the Promise.all. In a serverless Next.js/tRPC context, the request can finish before these async tasks complete, which can leave SendGrid/Twilio reminders active and still sending after a booking is cancelled. Previously the reminder deletions were awaited; you should collect these promises and await them (or res.waitUntil) so cancellations are guaranteed to persist.
Useful? React with 👍 / 👎.
Test 6nn---nReplicated from ai-code-review-evaluation/cal.com-cursor#6