GPT-6.1 Sol · Heavy

fix-handle-collective-multiple-host-on-destinationcalendar-cal-com

cal.com · TypeScript · S · 30–99 lines · 6 files

The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Haiku 5.5.

Gold bugs found
7 of 9
Comments published
8
Comments matching a bug
7
Comments not matching
1
Cost of this PR
$3.108

Published comments (8)

highbugpackages/core/EventManager.ts:170

Video booking references lose credential IDs needed for cancellation — Video bookings fail the credential-ID guard in `handleCancelBooking`, leaving external meetings undeleted on cancellation. Preserve `result.credentialId` for video results as well.

highbugpackages/app-store/googlecalendar/lib/CalendarService.ts:147-149

Legacy destinations without credentialId fall back to the primary calendar — Legacy destinations supported by `createAllCalendarEvents` lack `credentialId`, so this lookup silently sends their Google events to `primary`. Retain a configured-destination fallback for the legacy credential-selection path.

highbugpackages/features/bookings/lib/handleCancelBooking.ts:449-457

Recurring collective cancellations delete the first host's events repeatedly — The `bookingToDelete.user.credentials` loop repeatedly deletes the first host's events while leaving other hosts' events undeleted. Use `calendarCredential` and select each occurrence's reference by matching `credentialId` and `reference.type`.

highbugpackages/features/bookings/lib/handleNewBooking.ts:1077-1078

Missing organizer destination drops collective cohost calendars — When the organizer has no destination, optional chaining on `evt.destinationCalendar` silently discards connected cohosts' destinations. Initialize `evt.destinationCalendar` before appending `teamDestinationCalendars`.

highbugpackages/core/EventManager.ts:118-119

Missing destination calendar crashes Google Meet booking creation — With no destination calendar, reading `mainHostDestinationCalendar.integration` throws a `TypeError` for Google Meet bookings instead of using the Cal Video fallback; check `handleNewBooking` for the null case. Use `mainHostDestinationCalendar?.integration` in this condition.

highbugpackages/core/EventManager.ts:370

Cohost calendar events use the organizer's destination calendar — Office 365, Lark, and base CalDAV services select the first `destinationCalendar` entry, so cohost requests can fail or target the organizer's calendar. Pass `createEvent` an event containing only the current `destination`, or update those providers to match destinations by credential. **Also found in:** - `packages/app-store/office365calendar/lib/CalendarService.ts:73-76`

highbugpackages/app-store/googlecalendar/lib/CalendarService.ts:254-256

Missing calendar IDs break destination fallback for updates and deletions — When `externalCalendarId` is absent, this lookup cannot recover a configured destination, so updates fail and `deleteEvent` can leave non-primary events untouched. Resolve the appropriate configured destination in both expressions instead of searching by the missing `externalCalendarId`.

highbugpackages/trpc/server/routers/viewer/organizations/create.handler.ts:151

Reversed billing condition assigns organization slugs at the wrong stage — Billed organizations must retain `requestedSlug` until publication, while non-billed organizations need `slug` immediately. Restore `!IS_TEAM_BILLING_ENABLED` for the `slug` assignment and leave the metadata condition billing-enabled.

Gold bugs found (7)

highWhen externalCalendarId is absent, updateEvent/deleteEvent look for a destination calendar whose externalId equals that absent value, so the lookup never matches and the configured destination calendar is no longer used.
highThe organization slug is now set only when team billing is enabled (inverted condition), so with billing both slug and requestedSlug are set and without billing neither is.
highOffice365 (and Lark) createEvent ignore the new credentialId argument and always use the first destination calendar, so in collective bookings other hosts' credentials target the organizer's calendar instead of their own.
highThe Google Meet fallback reads mainHostDestinationCalendar.integration without optional chaining, so a Meet booking with a null or empty destinationCalendar throws instead of falling back to Cal Video.
highFor collective events whose organizer has no destination calendar, destinationCalendar is null and the optional push drops all other hosts' destination calendars, so those hosts never get calendar events.
highVideo booking references are now saved without their credentialId, so cancelling the booking can no longer find the video credential and the meeting is not deleted.
highCancelling all remaining occurrences of a recurring collective booking deletes only the first calendar reference of each booking, repeated once per host, so the other hosts' events stay on their calendars.

Gold bugs missed (2)

mediumIn Google createEvent, when no destination calendar matches the credentialId, the hangout-link events.patch is called with an undefined calendarId and fails, so the Meet link is not added to the event description.
mediumWhen cancelling a recurring booking with multiple calendar references, the recurring-event deletion over all remaining bookings and credentials runs once per reference, causing duplicate delete calls and errors.