Claude Opus 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
- $4.584
Published comments (10)
Destination calendar without credentialId loses externalId on created events — Without `destination.externalId`, `createEvent(c, event)` returns no `result.externalId`, so the reference stores no `externalCalendarId` and later updates and deletes hit the wrong calendar. Pass `destination.externalId` to `createEvent` in this branch too.
Recurring-series calendar delete repeats per reference and skips other hosts — Inside the per-reference loop, each collective-host reference deletes the organizer's `updatedBookings` events again, causing extra calls and 404/410 errors, while other hosts' recurring events are never deleted. Run the recurring delete once outside the loop, or scope it to the current reference's `credentialId`.
CalDAV createEvent always targets the organizer's destination calendar — `createAllCalendarEvents` calls `createEvent` per host credential, so a second collective host's event targets the organizer's `destinationCalendar[0]` and never reaches their calendar (Office365 and Lark do the same). Pick the destination calendar whose `credentialId` matches this credential, as the Google service does.
Crash on Google Meet bookings with no destination calendar — Cancellation, confirm and payment-webhook paths now pass a null or empty `destinationCalendar`, so for Google Meet locations `mainHostDestinationCalendar.integration` throws a TypeError and booking fails. Use `mainHostDestinationCalendar?.integration`.
Fallback calendar lookup compares against falsy externalCalendarId — Because the fallback only runs when `externalCalendarId` is falsy, matching `cal.externalId` against it always yields undefined, losing the old fallback to the destination calendar (`deleteEvent` has the same bug). Fall back to the first `destinationCalendar` entry's `externalId` instead. **Also found in:** - `packages/app-store/googlecalendar/lib/CalendarService.ts:315-317`
Collective hosts' calendars dropped when organizer has no destination calendar — With no event-type or organizer destination calendar, `evt.destinationCalendar` is `null`, so `evt.destinationCalendar?.push(...teamDestinationCalendars)` silently drops the other collective hosts' calendars. Initialize it to `[]` instead of `null` so team calendars are added.
Inverted billing condition sets org slug only when billing is enabled — Organizations now get a live `slug` before payment when billing is on, and none at all when it is off. Restore the original `!IS_TEAM_BILLING_ENABLED` condition.
Video booking references lose their `credentialId` — Video booking references lose the credential they were created with, which later update and delete steps rely on. Set `credentialId` to `result.credentialId` for both calendar and non-calendar results.
Plain Error for empty dynamicUserList is turned into a generic 500 — The catch only maps `HttpError` and Prisma errors to 400, so this plain `Error` becomes a 500 "Unable to load users", hiding the message and reporting bad input as a server error. Throw `HttpError` with `statusCode: 400` here, ideally with an i18n key like the rest of the file.
Raw Prisma error message leaked to unauthenticated booking clients — Prisma messages can include the query, table, field and constraint names and values, which the public booking endpoint returns to unauthenticated callers. Log the `PrismaClientKnownRequestError` server-side in `loadUsers` and return a generic message like "Unable to load users" instead of `error.message`.