Claude Sonnet 5.5 · 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
- 6 of 9
- Comments published
- 7
- Comments matching a bug
- 6
- Comments not matching
- 1
- Cost of this PR
- $1.089
Published comments (7)
TypeError on Google Meet booking when destinationCalendar is empty — Any Google Meet booking without a destination calendar crashes in `EventManager.create`, because `mainHostDestinationCalendar` is undefined. Use `mainHostDestinationCalendar?.integration` so the check fails safely.
Office365 createEvent uses first host's destination calendar for every credential — `EventManager` calls `createEvent` once per destination credential, yet it always uses `destinationCalendar[0]`. Other hosts' credentials then write to the wrong calendar, causing errors or duplicates.
Collective hosts' destination calendars dropped when destinationCalendar is null — Assign the combined, de-duplicated array instead of pushing.
Meet link patch uses undefined calendarId when no destination calendar matches — Compute `selectedCalendar` with the `"primary"` fallback once and use it in both the insert and the patch.
updateLocation loses externalCalendarId because updateEvent returns no externalId — `CalendarManager.updateEvent` never returns `externalId`, so `result.externalId` is undefined and references created after a location edit lose `externalCalendarId`, breaking later updates and deletes. Return `externalId` from `updateEvent`, or reuse the existing reference's `externalCalendarId`.
Recurring cancel deletes all remaining events once per calendar reference — The recurring-cancel branch now runs inside the `bookingCalendarReference` loop, so with N references each remaining event gets N delete calls, and the repeats fail or double-delete. Run it once, guarded by a flag or moved outside the loop.
deleteEvent fallback searches destinationCalendar for a falsy externalId, always undefined — The fallback only runs when `externalCalendarId` is falsy, yet it searches `event.destinationCalendar` for that falsy value, so it is always undefined and deletes hit `"primary"`. Use `event.destinationCalendar?.[0]?.externalId` instead. **Also found in:** - `packages/app-store/googlecalendar/lib/CalendarService.ts:254-256`