DeepSeek V4 Pro · 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 Opus 5.5.
- Gold bugs found
- 6 of 20
- Comments published
- 9
- Comments matching a bug
- 6
- Comments not matching
- 3
- Cost of this PR
- $1.679
Published comments (9)
Collective team calendars silently dropped when destinationCalendar is null — When both destination calendars are null, the optional chaining silently drops all team destination calendars, so collective hosts with connected calendars never get invited. Initialize the array instead of relying on `?.push`.
Duplicate deletes for recurring cancellation across calendar references — Each extra calendar reference re-runs the full credential and booking loop, issuing duplicate delete calls for collective cancellations. Move this block outside the reference loop and execute it once.
Use localization key for hard-coded loadUsers 500 error message — Users will see this error in English regardless of their locale, unlike neighboring `HttpError` messages that use translation keys. Replace the literal with a localization key such as `unable_to_load_users`.
Calendar credential key leaked to updateEvent error log — The fallback credential includes the raw `key` secret, and `updateEvent` logs the whole `credential` object when `bookingRefUid` is empty. Redact or omit `key` before passing it to the update path.
Unsafe access of destinationCalendar integration when no calendar exists — When no destination calendar exists the array is empty, so destructuring yields `undefined` and dereferencing `.integration` throws a `TypeError` instead of falling back to Cal Video. Use `mainHostDestinationCalendar?.integration !== "google_calendar"`.
Non-calendar branch drops video credentialId — Cancellation fails because the video reference is stored without a `credentialId`, but `handleCancelBooking.ts:491` only deletes when that field is truthy. Keep `result.credentialId` for non-calendar result types.
External calendar ID fallback compares cal.externalId to undefined — In the falsy branch the comparison always evaluates `undefined === undefined`, so `selectedCalendar` becomes undefined and `events.update` is called with a missing `calendarId`. Fall back to `event.destinationCalendar?.[0]?.externalId` instead. **Also found in:** - `packages/app-store/googlecalendar/lib/CalendarService.ts:315-317`
Org creation slug condition inverted — This flips the self-hosted behavior: billing-disabled orgs get a null `slug`, while billing-enabled orgs bypass the `requestedSlug` publishing flow. Restore the `!IS_TEAM_BILLING_ENABLED` condition for `slug`.
updateLocation drops destinationCalendar fallback for externalId/credentialId — `CalendarManager.updateEvent` never returns `externalId` or `credentialId`, so update flows now store undefined values and lose the previous destination-calendar fallback. Retain fallbacks to `evt.destinationCalendar?.[0]` for these fields.