Open milospuac opened 2 months ago
The issue of reminders for canceled bookings still being sent, as documented under CAL-3931, is due to the fact that the deletion of scheduled reminders is not being handled correctly in some cases. The provided code shows that there is a mechanism to delete scheduled reminders for canceled bookings, but it might not be executed properly or might fail silently.
The solution involves ensuring that all scheduled reminders are properly deleted when a booking is canceled. The code snippet below shows the relevant part where reminders are deleted:
const reminderMethods: { [x: string]: (id: number, referenceId: string | null) => void } = {
[WorkflowMethods.EMAIL]: deleteScheduledEmailReminder,
[WorkflowMethods.SMS]: deleteScheduledSMSReminder,
[WorkflowMethods.WHATSAPP]: deleteScheduledWhatsappReminder,
};
export const cancelWorkflowReminders = async (
workflowReminders: { method: WorkflowMethods; id: number; referenceId: string | null }[]
) => {
await Promise.all(
workflowReminders.map((reminder) => {
return reminderMethods[reminder.method](reminder.id, reminder.referenceId);
})
);
};
Ensure that this part of the code is executed correctly and that any errors are logged and handled appropriately. This should prevent reminders from being sent for canceled bookings [1][2].
To continue talking to Dosu, mention @dosu.
/assign i will solve this.
customer chris.chenko
From SyncLinear.com | CAL-3931