Files
calendar/packages/lib
devin-ai-integration[bot]GitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>joe@cal.com <joe@cal.com>Joe Au-Yeung
0207109612 fix: add validation for empty hosts in round robin reassignment (#22429)
* fix: add validation for empty hosts in round robin reassignment

- Add check for empty availableUsers array before calling getLuckyUser
- Throw RoundRobinHostsUnavailableForBooking error instead of 500 error
- Use existing error infrastructure with 409 status code and localized message
- Prevents runtime errors when no round robin hosts are available for reassignment

Co-Authored-By: joe@cal.com <joe@cal.com>

* fix: check eventType.hosts.length directly for empty hosts validation

- Move validation to check eventType.hosts.length === 0 immediately after hosts array setup
- Remove later validation after ensureAvailableUsers to catch issue earlier
- Follows user feedback to check hosts array directly instead of availableUsers

Co-Authored-By: joe@cal.com <joe@cal.com>

* fix: update translation message for round robin hosts unavailable error

- Make error message clearer about event type having no hosts
- Change from 'No Round Robin hosts is available for booking' to 'No hosts are available in this event type for round robin booking'

Co-Authored-By: joe@cal.com <joe@cal.com>

* Change error for event type no hosts

* fix: add ErrorCode.EventTypeNoHosts to switch statement for 400 status code

Addresses GitHub comment from keithwillcode to ensure EventTypeNoHosts
error returns proper 400 Bad Request status instead of defaulting to 500.

Co-Authored-By: joe@cal.com <joe@cal.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: joe@cal.com <joe@cal.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
2025-07-11 18:03:36 -03:00
..
2024-11-13 15:14:31 -05:00
2025-05-28 02:38:20 +01:00
2024-04-27 18:14:37 +02:00
2025-07-02 23:06:28 +05:30
2023-07-28 15:11:44 +00:00
2025-03-20 21:30:51 -03:00
2024-03-08 15:13:29 +00:00
2022-05-26 11:07:14 -06:00
2023-04-25 19:39:47 -03:00
2025-04-21 05:33:00 +00:00
2024-10-04 13:44:50 -07:00
2024-05-10 08:47:57 +01:00
2025-03-20 21:30:51 -03:00
2024-10-24 09:10:27 -04:00
2023-11-11 11:16:35 +00:00