Claude Sonnet 5.5 · 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
- 10
- Comments matching a bug
- 7
- Comments not matching
- 3
- Cost of this PR
- $2.805
Published comments (10)
Undefined credential passed to updateEvent aborts remaining calendar updates — An undefined `credential` reaches `updateEvent` and throws a TypeError, aborting updates for all remaining calendar references. Skip the reference or push a failure result when `credential` is not found.
Team destination calendars dropped when no event type or organizer calendar exists — Initialize it as `[]` instead of `null`.
createEvent omits destination.externalId when destination has no credentialId — Without `destination.externalId`, the saved reference has an undefined `externalCalendarId`, so reschedule and cancel lose the target calendar and Google falls back to "primary". Pass `destination.externalId` as the third argument to `createEvent`, and have the calendar services select by `externalId` when no `credentialId` matches.
TypeError on Google Meet booking when destinationCalendar is empty — Use `mainHostDestinationCalendar?.integration` so it falls back to Cal Video.
Calendar ID fallback in updateEvent can never match and yields undefined — The fallback `find` only runs when `externalCalendarId` is falsy, so it never matches and `selectedCalendar` is undefined, sending `events.update` and `events.patch` without a `calendarId`. Fall back to `mainHostDestinationCalendar?.externalId` or "primary" instead. **Also found in:** - `packages/app-store/googlecalendar/lib/CalendarService.ts:315-317`
Video booking references lose credentialId for non-calendar results — Video booking references no longer store their credential, so later reschedule and cancel flows that look it up by `credentialId` must guess. Keep `credentialId: result.credentialId` for non-calendar types.
events.patch uses undefined calendarId when no destination calendar matches — The later `events.patch` call still passes the raw `selectedCalendar`, which is often undefined now that `events.insert` falls back to "primary", so the Meet link patch fails or hits the wrong calendar. Compute `selectedCalendar` once with the "primary" fallback and use it in both calls.
Recurring calendar deletion runs once per reference inside loop — With N calendar references, the remaining bookings' events are deleted N times per credential, causing duplicate API calls and spurious errors. Move the recurring deletion outside the loop and keep only the non-recurring path per reference.
Raw Prisma error message leaked to client in loadUsers catch block — Prisma messages expose query and schema details, and `loadUsers` returns them to the booking client in a 400. Log the original error server-side and throw a generic "Unable to load users" instead.
Slug is set only when team billing is enabled, inverting original condition — The inverted condition sets `slug` only when `IS_TEAM_BILLING_ENABLED`, the opposite of the original behavior. Restore the negation with `!IS_TEAM_BILLING_ENABLED`.