Comprehensive workflow reminder management for booking lifecycle events#6
Comprehensive workflow reminder management for booking lifecycle events#6everettbu 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>
|
cursor review |
There was a problem hiding this comment.
Bugbot free trial expires on August 11, 2025
Learn more in the Cursor dashboard.
| 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.
Bug: Async Functions Not Awaited in Loops
Asynchronous functions deleteScheduledEmailReminder and deleteScheduledSMSReminder are called without await inside forEach loops. This occurs during booking rescheduling/cancellation, and workflow/workflow step deletion/updates. Consequently, scheduled workflow reminders may not be reliably cancelled, potentially leaving them active.
Locations (7)
packages/trpc/server/routers/viewer/bookings.tsx#L487-L494packages/features/bookings/lib/handleCancelBooking.ts#L486-L492packages/trpc/server/routers/viewer/workflows.tsx#L212-L217packages/trpc/server/routers/viewer/workflows.tsx#L376-L381packages/trpc/server/routers/viewer/workflows.tsx#L519-L524packages/trpc/server/routers/viewer/workflows.tsx#L574-L579packages/features/bookings/lib/handleNewBooking.ts#L966-L971
| }, | ||
| }); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Bug: Inconsistent Email Deletion Leaves Orphaned Records
When immediateDelete is true, the deleteScheduledEmailReminder function cancels the SendGrid email but fails to delete the corresponding WorkflowReminder record from the database. This creates orphaned database entries and is inconsistent with the immediateDelete: false path, which marks the record as cancelled. The SendGrid DELETE API call is also omitted in this path.
|
This PR is being marked as stale due to inactivity. |
Test 6