Skip to content

fix: bookings for guests added by organizer get cancelled when rescheduled#17820

Merged
TusharBhatt1 merged 11 commits intocalcom:mainfrom
kart1ka:fix/guests-bookings-get-cancelled-when-rescheduled
Feb 11, 2025
Merged

fix: bookings for guests added by organizer get cancelled when rescheduled#17820
TusharBhatt1 merged 11 commits intocalcom:mainfrom
kart1ka:fix/guests-bookings-get-cancelled-when-rescheduled

Conversation

@kart1ka
Copy link
Copy Markdown
Collaborator

@kart1ka kart1ka commented Nov 24, 2024

What does this PR do?

Screencast.from.25-11-24.12.25.13.AM.IST.webm

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Create a booking on team pro example account.
  2. Login to team pro example account and Go to /bookings/incoming page.
  3. Add guests to that booking.
  4. Now Reschedule the booking.
  5. Notice that the guests that were just added (by team pro example) are now included in the rescheduled booking.

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 24, 2024

@kart1ka is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app Bot added the community Created by Linear-GitHub Sync label Nov 24, 2024
@graphite-app graphite-app Bot requested a review from a team November 24, 2024 21:59
@github-actions github-actions Bot added bookings area: bookings, availability, timezones, double booking teams area: teams, round robin, collective, managed event-types 🐛 bug Something isn't working labels Nov 24, 2024
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Nov 24, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (11/24/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (11/24/24)

1 label was added to this PR based on Keith Williams's automation.

"Add ready-for-e2e label" took an action on this PR • (11/26/24)

1 label was added to this PR based on Keith Williams's automation.

Comment thread packages/lib/bookingSuccessRedirect.ts
Copy link
Copy Markdown
Contributor

@Praashh Praashh left a comment

Choose a reason for hiding this comment

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

LGTM!!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 26, 2024

E2E results are ready!

@anikdhabal anikdhabal marked this pull request as draft November 26, 2024 18:48
@anikdhabal anikdhabal marked this pull request as ready for review December 1, 2024 16:22
Copy link
Copy Markdown
Contributor

@anikdhabal anikdhabal left a comment

Choose a reason for hiding this comment

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

Working fine, but I will check the code once before shipping

@anikdhabal anikdhabal marked this pull request as draft December 2, 2024 19:30
@github-actions
Copy link
Copy Markdown
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions Bot added the Stale label Dec 17, 2024
Copy link
Copy Markdown
Contributor

@Praashh Praashh left a comment

Choose a reason for hiding this comment

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

@kart1ka can you please resolve merge conflicts?

@kart1ka
Copy link
Copy Markdown
Collaborator Author

kart1ka commented Dec 17, 2024

@kart1ka can you please resolve merge conflicts?

On it.

@kart1ka
Copy link
Copy Markdown
Collaborator Author

kart1ka commented Dec 17, 2024

@kart1ka can you please resolve merge conflicts?

Merge conflicts resolved.

@github-actions github-actions Bot removed the Stale label Dec 18, 2024
@anikdhabal anikdhabal marked this pull request as ready for review January 20, 2025 10:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 7, 2025

This PR is being marked as stale due to inactivity.

@github-actions github-actions Bot added the Stale label Feb 7, 2025
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 7, 2025

CLA assistant check
All committers have signed the CLA.

Comment thread packages/features/bookings/lib/handleNewBooking.ts Outdated
@TusharBhatt1
Copy link
Copy Markdown
Contributor

TusharBhatt1 commented Feb 11, 2025

@kart1ka tested and LGTM , once the comment is resolved , let's take this ahead

@kart1ka
Copy link
Copy Markdown
Collaborator Author

kart1ka commented Feb 11, 2025

@kart1ka tested and LGTM , once the comment is resolved , let's take this ahead

Done

Copy link
Copy Markdown
Contributor

@TusharBhatt1 TusharBhatt1 left a comment

Choose a reason for hiding this comment

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

Tested works well , LGTM !

@TusharBhatt1 TusharBhatt1 merged commit e29b42a into calcom:main Feb 11, 2025
Comment on lines +913 to +935

if (originalRescheduledBooking) {
const eventHosts = eventType.hosts.length
? eventType.hosts
: eventType.users.map((user) => ({ user, isFixed: false }));

// For round-robin bookings, find the host from original rescheduled booking
const originalRoundRobinHost = eventHosts.find(
(host) =>
!host.isFixed &&
originalRescheduledBooking?.attendees.some((attendee) => attendee.email === host.user.email)
)?.user;

const isSameRRHost = !!originalRescheduledBooking?.userId && eventType.rescheduleWithSameRoundRobinHost;

// Get the list of team members for original rescheduled booking
const originalRescheduledBookingTeamMembers = (
isTeamEventType && eventType.schedulingType === SchedulingType.ROUND_ROBIN && !isSameRRHost
? [...users.slice(0, -1), originalRoundRobinHost]
: [...users]
).filter((user) => user?.email !== organizerUser.email);

// Get guests that were added by the booker in the original booking
Copy link
Copy Markdown
Contributor

@anikdhabal anikdhabal Feb 11, 2025

Choose a reason for hiding this comment

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

@kart1ka Is this the right place for the changes? I think we should fix the addGuest handler and find out why it is causing this error. It should be similar to how we normally do it from the booking page. Not confident about the recent changes

keithwillcode added a commit that referenced this pull request Feb 11, 2025
Udit-takkar pushed a commit that referenced this pull request Feb 21, 2025
…duled (#17820)

* fix: bookings for guests added by organizer get cancelled when rescheduled

* chore

---------

Co-authored-by: Tushar Bhatt <95581504+TusharBhatt1@users.noreply.github.com>
MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Feb 25, 2025
…duled (calcom#17820)

* fix: bookings for guests added by organizer get cancelled when rescheduled

* chore

---------

Co-authored-by: Tushar Bhatt <95581504+TusharBhatt1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bookings area: bookings, availability, timezones, double booking 🐛 bug Something isn't working community Created by Linear-GitHub Sync ready-for-e2e Stale teams area: teams, round robin, collective, managed event-types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bookings for Guests Added by Organiser or Team Owner get cancelled when the booking is rescheduled

5 participants