MiniMax M3 · 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
- 2 of 9
- Comments published
- 5
- Comments matching a bug
- 2
- Comments not matching
- 3
- Cost of this PR
- $0.221
Published comments (5)
Optional-chain missing on mainHostDestinationCalendar.integration — Reading `mainHostDestinationCalendar.integration` without optional chaining crashes `EventManager.create` when the entry is absent. Add the `?.` to safely short-circuit.
updateEvent fallback returns undefined calendarId when externalCalendarId missing — The `.find` filter can never match when `externalCalendarId` is falsy, so the request ships `calendarId: undefined` and fails. Mirror `selectedCalendar`'s fallback to `mainHostDestinationCalendar?.externalId` via destructuring.
deleteEvent falls back to undefined calendar when externalCalendarId is null — The same broken `.find` in `deleteEvent` forwards `calendarId: undefined` and targets nothing. Destructure `mainHostDestinationCalendar` first and combine with `externalCalendarId`, respecting the existing `defaultCalendarId` guard.
teamDestinationCalendars duplicates accumulate in handleNewBooking — `handleNewBooking` pushes `teamDestinationCalendars` for each member without deduping, so duplicates grow on collective events. Skip insertion when `user.destinationCalendar?.id` already exists in the array.
destinationCalendar falls back to empty instead of user.destinationCalendar — Without a fallback to `bookingToReschedule.user?.destinationCalendar`, reschedule emails and webhook payloads ship `destinationCalendar: []`. Mirror the sibling handlers' pattern before defaulting to an empty array.