Skip to content

fix: handle collective multiple host on destinationCalendar#9

Open
ShashankFC wants to merge 1 commit into
enhance-collective-scheduling-foundationfrom
fix/handle-collective-multiple-host-destinations
Open

fix: handle collective multiple host on destinationCalendar#9
ShashankFC wants to merge 1 commit into
enhance-collective-scheduling-foundationfrom
fix/handle-collective-multiple-host-destinations

Conversation

@ShashankFC

@ShashankFC ShashankFC commented Feb 13, 2026

Copy link
Copy Markdown

User description

Test 4nn

Summary by CodeRabbit

Release Notes

  • New Features

    • Events can now be synced to multiple destination calendars for greater scheduling flexibility
    • Team scheduling now supports per-member calendar configurations for collective events
  • Improvements

    • Enhanced calendar credential resolution and management across integrations
    • Better handling of calendar references during booking operations and updates

✏️ Tip: You can customize this high-level summary in your review settings.

nn---n*Replicated from [ai-code-review-evaluation/cal.com-coderabbit#4](https://github.com/ai-code-review-evaluation/cal.com-coderabbit/pull/4)*

CodeAnt-AI Description

Handle multiple destination calendars for collective/team bookings and pick the correct calendar credential

What Changed

  • destinationCalendar is now treated as an array in events and booking flows so team/collective bookings can include multiple host calendars.
  • Calendar providers (Google, Lark, Office365, iCal/DAV) now pick the correct calendar entry from the destinationCalendar array (by credentialId or externalId) before creating, updating, or deleting events.
  • Event creation/update pipeline iterates destination calendars and uses matching credentials (including fetching missing credentials from the DB) to create/update events per host; booking cancellations delete events for all referenced calendars.
  • Several booking webhook and payment handlers now wrap single destinationCalendar values into arrays so downstream calendar logic receives a consistent structure.
  • Minor user-visible fixes: organizer note wording ("organizer") and safer fallbacks when no destination calendar is found (use primary calendar or no calendar).

Impact

✅ Fewer failed calendar inserts (reduced Google 404s)
✅ Correct host calendar selected for team/collective bookings
✅ Fewer orphan calendar events after cancellations

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@ShashankFC

Copy link
Copy Markdown
Author

@CodeAnt-AI: review

@codeant-ai

codeant-ai Bot commented Feb 13, 2026

Copy link
Copy Markdown

CodeAnt AI is running the review.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Feb 13, 2026
@codeant-ai

codeant-ai Bot commented Feb 13, 2026

Copy link
Copy Markdown

Sequence Diagram

This PR changes destinationCalendar from a single object to an array and updates the event creation/update/delete flows to iterate destination calendars, resolve credentials per destination (including DB lookups), and call calendar provider services (Google/Lark/Office) with the correct credential and externalCalendarId. The diagram shows the main success path for creating events across multiple destination calendars.

sequenceDiagram
    participant Organizer
    participant EventManager
    participant CredentialStore
    participant CalendarService
    participant Provider

    Organizer->>EventManager: Create booking (evt.destinationCalendar = [dest1, dest2...])
    EventManager->>CredentialStore: Resolve credential for each destination (in-memory or DB)
    CredentialStore-->>EventManager: credential (or fetched credential)
    EventManager->>CalendarService: createEvent(calEvent, credentialId, externalId)
    CalendarService->>Provider: call provider API using mainHostDestinationCalendar.externalId (or externalId)
    Provider-->>CalendarService: createdEvent (id, iCalUID, url)
    CalendarService-->>EventManager: NewCalendarEventType
    EventManager-->>Organizer: Aggregate results (references for each destination)
Loading

Generated by CodeAnt AI

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

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants