DeepSeek V4.1 Flash · 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
- 6 of 9
- Comments published
- 9
- Comments matching a bug
- 6
- Comments not matching
- 3
- Cost of this PR
- $0.292
Published comments (9)
updateLocation drops externalCalendarId for updated events — `CalendarManager.updateEvent` never sets `externalId`, so location changes persist references without an `externalCalendarId`, and later deletes hit `primary`. Fall back to `evt.destinationCalendar?.[0]?.externalId` when `result.externalId` is absent.
Video booking references lose credentialId, so meetings are never deleted on cancel — `handleCancelBooking.ts:491` has no else branch, so an undefined video `credentialId` means the Zoom/Daily/Meet meeting is never deleted on cancellation. Restore the video fallback so `createMeeting`'s `credentialId` is persisted.
Dereference of possibly undefined mainHostDestinationCalendar — `handleNewBooking` sets `destinationCalendar` to `null` and the webhooks set `[]`, so this throws a TypeError for a Google Meet booking when the organizer has no destination calendar instead of falling back to Cal Video. Guard the dereference.
Dead selectedCalendar fallback passes undefined calendarId — The `find` only runs when the predicate's value is falsy, so it never matches and `calendar.events.update` gets an undefined `calendarId`. Fall back to `event.destinationCalendar?.[0]?.externalId` or match on `credentialId`.
deleteEvent destination calendar lookup always falls back to primary — The `find` can never match a falsy `externalCalendarId`, so every delete falls back to "primary" and events on secondary destination calendars are never deleted. Use the destination calendar's `externalId` as the fallback.
Collective team destination calendars dropped when organizer calendar is null — `destinationCalendar` is set to `null` a few lines above when no destination calendar exists, so the optional push silently drops every `teamDestinationCalendars` entry. Assign the merged array instead of pushing.
Hangout-link patch uses undefined calendarId when no matching destination calendar — Google Meet bookings with no matching destination calendar fail the patch and lose the updated description. Apply the same `|| "primary"` fallback to the `calendar.events.patch` call.
Recurring cancellation repeats deletes for each calendar reference — The recurring branch now runs once per calendar reference while still looping over credentials and `updatedBookings`, so a collective with N references deletes the same events N times. Run it once when `allRemainingBookings` is set.
Organizer email uses first destination calendar, not credential's — With `destinationCalendar` now an array of every host's calendar, an event created with host B's credential is sent with host A's email as organizer. Match the destination calendar by `credentialId` (as `selectedCalendar` does) before using its `externalId`.