Skip to content

fix: allow initial reservation for seated events#29467

Open
pranavv00 wants to merge 1 commit into
calcom:mainfrom
pranavv00:fix/seated-event-slot-reservation
Open

fix: allow initial reservation for seated events#29467
pranavv00 wants to merge 1 commit into
calcom:mainfrom
pranavv00:fix/seated-event-slot-reservation

Conversation

@pranavv00
Copy link
Copy Markdown
Contributor

Summary

Fixes #29448 where seated event slot reservations could incorrectly fail for the very first booking attempt.

Changes

  • Remove the fallback branch that set shouldReserveSlot = false when no existing booking was found
  • Check bookingAttendeesLength !== undefined instead of relying on truthiness

Result

Slot reservations now remain allowed when no booking exists yet, while still correctly preventing reservations once the seat limit is reached.

The else branch incorrectly set shouldReserveSlot=false when no
existing booking was found (bookingWithAttendees undefined), blocking
the first reservation attempt for seated events. Also changed the
truthy check to !== undefined so 0 attendees enters the seat-check
logic correctly.
@github-actions github-actions Bot added the 🐛 bug Something isn't working label May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @pranavv00! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4e3941ba-d80b-4d0a-8e8a-b31ab854d1f8

📥 Commits

Reviewing files that changed from the base of the PR and between 180ede2 and 0696e46.

📒 Files selected for processing (1)
  • apps/api/v2/src/modules/slots/slots-2024-04-15/services/slots.service.ts

📝 Walkthrough

Walkthrough

This PR refines the slot reservation logic in SlotsService_2024_04_15. The reserveSlot method changes how it determines whether to compute seat availability by moving from a truthy check on bookingAttendeesLength to an explicit definition check. This affects reservation behavior when attendee count is zero or when booking context is undefined. The constructor formatting is also corrected.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: fixing a bug that prevented initial reservations for seated events.
Description check ✅ Passed The description is directly related to the changeset, explaining the problem, the changes made, and the expected result.
Linked Issues check ✅ Passed The PR addresses issue #29448 by fixing the logic that incorrectly blocked first reservations for seated events when bookingUid is absent.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the reservation logic for seated events; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HIGH: Seated event slot reservation blocks the very first reservation

1 participant