You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR implements support for multiple destination calendars in collective scheduling scenarios, changing destinationCalendar from a single object to an array throughout the codebase. This allows each host in a collective event to have their own calendar destination.
Good: Now correctly searches through the array for matching credentialId.
However, there's no fallback or error handling if no matching calendar is found.
Logic Error in deleteEvent (packages/app-store/googlecalendar/lib/CalendarService.ts:317)
This logic is circular - if externalCalendarId exists, use it; otherwise find a calendar with externalId === externalCalendarId. The second part will never execute since externalCalendarId is already checked.
Typo Fix Missed in handleNewBooking (packages/features/bookings/lib/handleNewBooking.ts:370)
evt.destinationCalendar could be null, which would cause a runtime error. Should use optional chaining or ensure it's initialized.
Missing credentialId parameter in calendar service calls
In CalendarService.ts (base class), the createEvent method signature needs updating to match the interface
🟢 Positive Changes
✅ Comprehensive update across all affected files
✅ Added proper credential fetching from database as fallback
✅ Fixed duplicate conditional in EventManager.ts (line 573-574)
✅ Better error handling in handleNewBooking.ts with try-catch blocks
✅ Improved team member handling for collective events
✅ Proper filtering and iteration over multiple calendar references
⚠️ Suggestions
Add Validation: Consider adding validation to ensure destinationCalendar array is not empty when required
Documentation: Add JSDoc comments explaining the collective scheduling behavior and when multiple calendars are used
Testing: Ensure comprehensive tests cover:
Single host events (array with 1 element)
Collective events with multiple hosts
Edge cases where destinationCalendar might be null or empty
Consistent Handling: Define a clear strategy for which calendar(s) should receive events in collective scheduling
📝 Summary
The PR successfully implements the core functionality of handling multiple destination calendars. However, there are 3 critical type safety issues where calendar service implementations don't match the updated interface signature. These must be fixed before merging.
The medium-priority issues around array handling and null checks should also be addressed to prevent potential runtime errors in production.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test 4
Replicated from ai-code-review-evaluation/cal.com-greptile#4