GLM-5.3 Flash · 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 Opus 5.5.
- Gold bugs found
- 9 of 18
- Comments published
- 10
- Comments matching a bug
- 9
- Comments not matching
- 1
- Cost of this PR
- $0.191
Published comments (10)
Adding guests to seated bookings overbooks slots and skips BookingSeat creation — Attendees get created without seats, so they can't be managed or cancelled per-seat and become invisible in seat-based views. Reject seated bookings early, as the fix does, or create `BookingSeat` rows after checking remaining capacity.
EventManager built with caller's credentials instead of organizer's — When the caller is an attendee or team admin, their credentials get used against the organizer's external calendar event and the update fails, so new guests never appear on it. Build the `EventManager` from `booking.user` instead of `ctx.user`.
Team admins rejected: isTeamAdmin && isTeamOwner only passes for owners — Team admins who are neither organizer nor attendee get a FORBIDDEN error, contradicting the intent of `isTeamAdminOrOwner`. Since `isTeamAdmin` already covers admins and owners, combine the checks with `||` instead of `&&`.
Guest emails with uppercase characters bypass the guest email blocklist — A guest like 'Spam@x.com' gets added and emailed despite being blocked. Compare `guest.toLowerCase()` against `blacklistedGuestEmails`, matching `checkIfBookerEmailIsBlocked` which lowercases both sides.
Team bookings build CalendarEvent without team, so team hosts miss guest emails — Additional team-member hosts never receive the guests-added email, and subjects fall back to the organizer's personal name. Populate `team` on `evt` from the booking's event type team, fetching its name and accepted members as `handleNewBooking` does.
Unbounded guests array allows mass attendee/email abuse — A single request can insert thousands of attendee rows and send mass emails to arbitrary third parties through Cal.com's mail infrastructure. Cap the `guests` array with `.max(10)` and consider a per-request limit in the handler.
isInvalidEmail banner never cleared on success, persists across dialog opens — The stale 'Emails must be unique and valid' banner reappears the next time the dialog opens after a successful add. Reset it with `setIsInvalidEmail(false)` in `onSuccess` and at the start of a passing validation in `handleAdd`.
Booking-ID oracle: distinct NOT_FOUND vs FORBIDDEN errors leak booking existence — Any authenticated user can probe this mutation to enumerate valid booking IDs across the system by comparing the two error responses. Scope the lookup to bookings the caller can access, or return `booking_not_found` for unauthorized IDs too.
Duplicate emails in guests array create duplicate attendee rows — Duplicate attendee rows cause repeated guest emails and duplicate calendar updates, even from concurrent requests. Dedupe the `guests` input case-insensitively in the handler as shown, or add a unique constraint on `Attendee`.
sendAddGuestsEmails receives raw guests instead of filtered uniqueGuests — Guests already on the booking receive a fresh 'confirmed' invitation with an .ics file even though nothing changed for them. Pass `uniqueGuests` instead of `guests` to `sendAddGuestsEmails`.