DeepSeek V4.1 Flash · Balanced
add-guest-management-functionality-to-existing-bookings-cal-com
cal.com · TypeScript · M · 100–299 lines · 6 files
The normal review, with one generalist agent. Judge: Claude Haiku 5.5.
- Gold bugs found
- 4 of 8
- Comments published
- 8
- Comments matching a bug
- 4
- Comments not matching
- 4
- Cost of this PR
- $0.117
Published comments (8)
Team admins rejected because admin/owner checks are combined with && — Since `isTeamAdmin` already matches ADMIN or OWNER, the `&&` with `isTeamOwner` rejects admins who are not owners. Use `||`, or just `isTeamAdmin`, so team admins can add guests.
addGuests allows adding guests to cancelled or rejected bookings — Without a `booking.status` check, a cancelled or rejected booking gets new attendees and a CONFIRMED invite, resurrecting it in every calendar. Reject `CANCELLED` and `REJECTED` bookings before adding guests.
Guest email blacklist and duplicate checks are case-sensitive — Because `blacklistedGuestEmails` is lowercased but `guest` is not, changing the casing bypasses `BLACKLISTED_GUEST_EMAILS`. Lowercase both sides as in checkIfBookerEmailIsBlocked.ts, and normalize the attendee duplicate comparison too.
Attendees can append guests to someone else's booking — The `isAttendee` clause lets any attendee append arbitrary addresses to someone else's booking, sending invites and branded emails as the organizer. Restrict this mutation to `isOrganizer` or `isTeamAdminOrOwner`, or require organizer confirmation.
Add guests action bypasses disableGuests and seatsPerTimeSlot — Guests can be added to event types with `disableGuests` or `seatsPerTimeSlot`, bypassing those constraints and creating seatless `Attendee` rows. Guard both the `add_members` action and `addGuestsHandler` against both fields.
Non-atomic duplicate attendee check allows concurrent duplicate guests — The `booking.attendees.some` check and `createMany` are not atomic, so concurrent calls insert duplicate attendee rows. Run the check and insert in a transaction with a unique index on (bookingId, email), or lock per booking.
sendAddGuestsEmails receives raw guests instead of filtered uniqueGuests — Passing raw `guests` to `sendAddGuestsEmails` sends a second full confirmation to addresses already filtered out of `uniqueGuests`. Pass `uniqueGuests` instead.
Deduplicate guest emails inside the addGuests request payload — `uniqueGuests` never dedupes against itself, so repeated emails in one payload are inserted twice by `createMany` and get two invites. Dedupe `guests` through a `Set` before filtering.