GPT-6.1 Sol · Balanced
fix-handle-collective-multiple-host-on-destinationcalendar-cal-com
cal.com · TypeScript · S · 30–99 lines · 6 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 7 of 9
- Comments published
- 7
- Comments matching a bug
- 7
- Comments not matching
- 0
- Cost of this PR
- $1.552
Published comments (7)
Google Meet bookings crash when destination calendars are empty or absent — Dereferencing `mainHostDestinationCalendar.integration` prevents the fallback to Cal Video when no destination is available. Restore optional chaining on `mainHostDestinationCalendar` in this condition.
Video booking references lose credentials required for cancellation — Without `credentialId`, `handleCancelBooking` cannot delete dedicated video meetings when bookings are canceled. Preserve `result.credentialId` for video results as well as calendar results.
Secondary hosts use the organizer's destination calendar — The Office 365, Lark, and base calendar adapters select the first entry in `event.destinationCalendar`, sending secondary hosts' events to the wrong calendar. Pass only the current credential's `destination` in `event.destinationCalendar` when calling `createEvent`.
Missing calendar IDs break destination fallback for updates and deletions — For older references without `externalCalendarId`, the `selectedCalendar` fallback resolves to `primary`, causing updates to fail for events on other calendars. Restore the configured destination fallback in both `updateEvent` and `deleteEvent`.
Recurring collective cancellations repeat organizer deletions and skip hosts — Looping over `bookingToDelete.user.credentials` and selecting the first calendar reference repeats organizer deletions while leaving secondary hosts' events undeleted. Match each occurrence's `bookingRef` to `reference.type` and `credentialId`, then delete it using the already resolved host credential.
Collective host calendars are dropped when the organizer has no destination — Optional chaining on a null `evt.destinationCalendar` silently discards every collected secondary-host destination. Initialize `evt.destinationCalendar` to an empty array before appending `teamDestinationCalendars`.
Organization creation loses all slug sources when team billing is disabled — Without `slug` or `metadata.requestedSlug`, `createTeams` rejects the organization and `publish` has no slug to publish. Invert the `IS_TEAM_BILLING_ENABLED` condition for the direct `slug` assignment so a slug source is always persisted.