calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
31.88k stars 7.8k forks source link

[CAL-3555] Reschedule URL variable not showing up in the workflow if the same workflow is applied to multiple events #14752

Open milospuac opened 5 months ago

milospuac commented 5 months ago

image

From SyncLinear.com | CAL-3555

dosubot[bot] commented 5 months ago

It appears the issue with the reschedule URL variable not showing up in the workflow when applied to multiple events is tied to specific conditions in the codebase. The visibility of the reschedule link is controlled by a condition that checks if the event is not a recurring event. This is found in the ManageLink.tsx file with the line:

const shouldDisplayRescheduleLink = Boolean(hasRescheduleLink && !isRecurringEvent);

This means the reschedule link will only be displayed if the event is not recurring and a reschedule link is available. The hasRescheduleLink variable is determined by the presence of a rescheduleLink, which is generated based on the event details.

Recent changes in the codebase, particularly how the rescheduleLink is constructed, could also affect its visibility. The link is formed using the bookerUrl and appending /reschedule/ followed by the booking's unique identifier. Any modifications in the generation of bookerUrl or handling of reminder.booking.uid could impact the functionality of the reschedule URL in workflow emails.

The system's handling of different languages and workflows applied to multiple events involves specific code implementations. For instance, the system uses the useLocale hook and translation functions to display warning messages and other texts in the user's preferred language. Workflows are managed through a user interface that allows activation or deactivation for specific event types, with a focus on maintaining a list of active event type IDs for each workflow.

For the reschedule URL variable's expected behavior, key functionalities include redirecting to the schedule page for rescheduling, handling of cancelled or rejected bookings, and validation of booking existence and status. These are managed through various checks and functionalities detailed in the codebase, such as in the reschedule/[uid].tsx file.

Understanding these aspects of the codebase can help in diagnosing and resolving the issue with the reschedule URL variable not appearing as expected. If further clarification or assistance is needed, feel free to ask.

#### Details **Sources** - [Event URL variable for workflows](https://github.com/calcom/cal.com/issues/7251) - [[CAL-3219] [CAL-3218] {RESCHEDULE_URL} is returning "undefined" in the url and not working](https://github.com/calcom/cal.com/issues/13885) - [packages/emails/src/components/ManageLink.tsx](https://github.com/calcom/cal.com/blob/main/packages/emails/src/components/ManageLink.tsx) - [packages/features/ee/workflows/api/scheduleEmailReminders.ts](https://github.com/calcom/cal.com/blob/main/packages/features/ee/workflows/api/scheduleEmailReminders.ts) - [packages/lib/isRecurringEvent.ts](https://github.com/calcom/cal.com/blob/main/packages/lib/isRecurringEvent.ts) - [packages/features/ee/workflows/pages/workflow.tsx](https://github.com/calcom/cal.com/blob/main/packages/features/ee/workflows/pages/workflow.tsx) - [packages/core/builders/CalendarEvent/builder.ts](https://github.com/calcom/cal.com/blob/main/packages/core/builders/CalendarEvent/builder.ts) - [packages/trpc/server/routers/viewer/workflows/activateEventType.handler.ts](https://github.com/calcom/cal.com/blob/main/packages/trpc/server/routers/viewer/workflows/activateEventType.handler.ts) - [packages/features/ee/workflows/lib/reminders/reminderScheduler.ts](https://github.com/calcom/cal.com/blob/main/packages/features/ee/workflows/lib/reminders/reminderScheduler.ts) - [packages/features/ee/workflows/components/EventWorkflowsTab.tsx](https://github.com/calcom/cal.com/blob/main/packages/features/ee/workflows/components/EventWorkflowsTab.tsx) - [packages/trpc/server/routers/viewer/workflows/update.handler.ts](https://github.com/calcom/cal.com/blob/main/packages/trpc/server/routers/viewer/workflows/update.handler.ts) - [apps/web/test/lib/handleChildrenEventTypes.test.ts](https://github.com/calcom/cal.com/blob/main/apps/web/test/lib/handleChildrenEventTypes.test.ts) - [apps/web/playwright/reschedule.e2e.ts](https://github.com/calcom/cal.com/blob/main/apps/web/playwright/reschedule.e2e.ts) - [apps/web/pages/reschedule/[uid].tsx](https://github.com/calcom/cal.com/blob/main/apps/web/pages/reschedule/[uid].tsx)
**About Dosu** This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

bparlan commented 1 month ago

I assigned my workflow only 1 Seated event (6 participant limit), and not using recurring at all, yet I receive 'undefined' URL for both Cancelation and Rescheduling, in both Host and User emails. Am I missing something? ps. sorry for disturbing @dosu

Screenshot 2024-08-21 at 18 03 03