Claude Opus 5.5 · Heavy
add-guest-management-functionality-to-existing-bookings-cal-com
cal.com · TypeScript · M · 100–299 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
- 5 of 8
- Comments published
- 7
- Comments matching a bug
- 5
- Comments not matching
- 2
- Cost of this PR
- $3.002
Published comments (7)
EventManager uses the caller's credentials instead of the booking organizer's — When an attendee or team admin adds guests, the organizer's calendar events can't be updated, or the wrong account's calendars get used. Build the `EventManager` from `booking.user` and its credentials instead of `ctx.user`.
isTeamAdminOrOwner uses && so it requires both admin and owner — A team admin who isn't also an owner, or an owner who isn't an admin, gets FORBIDDEN despite being allowed. Combine `isTeamAdmin` and `isTeamOwner` with `||` instead of `&&`.
Case-sensitive email comparison bypasses guest blacklist and duplicate check — Submitting `Blocked@Example.com` bypasses `BLACKLISTED_GUEST_EMAILS`, and case variants of existing attendees get added again. Lowercase `guest` and `attendee.email` before comparing.
Unbounded `guests` array allows mass attendee creation and email spam — Any attendee can create unlimited attendee rows in one request and make the server email arbitrary addresses, which enables spam from the app's domain. Add a `.max(...)` limit to the `guests` array.
Permission error uses missing locale key "you_do_not_have_permission" — `AddGuestsDialog` shows this through `t(err.message)`, and the key is missing from the en `common.json` locale file, so users see the raw `you_do_not_have_permission` string. Add the key to the locale files or reuse an existing permission-error key.
Duplicate guest emails can create duplicate attendee rows — Repeated or differently cased emails in `guests`, or two concurrent requests, can insert duplicate Attendee rows through `createMany`, because `uniqueGuests` only filters out existing attendees and blacklisted emails. Deduplicate case-insensitively within `guests` and recheck existing attendees inside a transaction at insert time.
Raw `guests` passed to `sendAddGuestsEmails` instead of `uniqueGuests` — Existing attendees whose emails appear in the input get the new-booking `AttendeeScheduledEmail` instead of the guests-added notice. Pass `uniqueGuests` to `sendAddGuestsEmails` instead of `guests`.