Skip to content

Comprehensive workflow reminder management for booking lifecycle events#5

Draft
ShashankFC wants to merge 1 commit into
workflow-queue-basefrom
workflow-queue-enhanced
Draft

Comprehensive workflow reminder management for booking lifecycle events#5
ShashankFC wants to merge 1 commit into
workflow-queue-basefrom
workflow-queue-enhanced

Conversation

@ShashankFC

Copy link
Copy Markdown
Collaborator

Test 6nn---nReplicated from ai-code-review-evaluation/cal.com-cursor#6

…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>
@GitHoobar

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment on lines 486 to +490
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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