fix: Use Google recurring events protocol#12651
Conversation
|
@haranrk is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
|
|
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 Five Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
For every event of the recurring booking a new recurring google calendar event is created for me. So I end up with a ton of calendar events in my google calendar: @haranrk I don't see this happening in your loom. Any idea why this is happening? |
|
@CarinaWolli, I just pulled the latest changes and tested it on my end and it worked correctly. Can you give the details of the event you created? In the interest of speed, would it be possible to get on a video conferencing call with you to identify the bug? https://cal.com/haranrk/30min |
hariombalhara
left a comment
There was a problem hiding this comment.
Great work @haranrk 🙏 Left some comments
|
@CarinaWolli @hariombalhara made the changes, PTAL |
9b9c17b to
917a71d
Compare
|
PTAL at these and let me know how you would like me to resolve them https://github.com/calcom/cal.com/pull/12651/files#r1442416872 |
Replied inline |
| recurringEventReq, | ||
| { | ||
| isNotAnApiCall: true, | ||
| skipAvailabilityCheck: key >= numSlotsToCheckForAvailability || thirdPartyRecurringEventId !== null, |
There was a problem hiding this comment.
Also, I wanted to point out that for the calendar apps that don't implement recurring api(all except Google Calendar) at the moment, thirdPartyRecurringEventId comes as undefined which is not really a value but skipAvailabilityCheck is correctly calculated because null !== undefined.
We should explicitly handle this.
|
|
||
| createdBookings.push(eachRecurringBooking); | ||
|
|
||
| if (!thirdPartyRecurringEventId) { |
There was a problem hiding this comment.
This condition would be truthy here for every iteration of non-recurring event supported calendars
haranrk
left a comment
There was a problem hiding this comment.
@hariombalhara I fixed the bug and rewrote the code to make it more easy to read. Since, the skipAvailabilityCheck is not being used anywhere else, I removed it.
| availableUsers.filter((user) => user.isFixed).length !== users.filter((user) => user.isFixed).length | ||
| ) { | ||
| throw new Error(ErrorCode.HostsUnavailableForBooking); | ||
| if (!req.body.allRecurringDates || req.body.isFirstRecurringSlot) { |
| if (req.body.allRecurringDates) { | ||
| if (req.body.isFirstRecurringSlot) { |
There was a problem hiding this comment.
| if (req.body.allRecurringDates) { | |
| if (req.body.isFirstRecurringSlot) { | |
| if (req.body.allRecurringDates && req.body.isFirstRecurringSlot) { |
|
It's merged 🎉Thanks @haranrk 🙏 |

What does this PR do?
Uses the native recurring cal API of google calendar to make recurring bookings.
Features -
Partially fixes #11655 as only the support for Google Calendar is added. Though it should be quick to support other Calendars.
https://www.loom.com/share/e66dad98c4a54d229b480bebf15b074f
Requirement/Documentation
Previous recurring event flow
recurring-event->handleNewBooking->eventManager->calendarManager->googleCalendarServiceNew recurring event flow
recurring-event->handleNewBooking->eventManager->calendarManager->googleCalendarServicecal.comhousekeeping necessary like creating videoconferencing links, making newcal.comdb records etc.Type of change
How should this be tested?
Mandatory Tasks
Checklist