Skip to content

Conversation

@Udit-takkar
Copy link
Contributor

@Udit-takkar Udit-takkar commented Dec 16, 2025

What does this PR do?

Fixes: #25709

  1. Assign users to team event type and enable this toggle
Screen.Recording.2026-01-14.at.3.59.18.PM.mov
  1. Select location app for each user and test various scenarios

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Summary by cubic

Adds per-host custom locations for round-robin event types so each host can set their own meeting location. Bookings use the organizer’s location, auto-link matching credentials, and fall back to Cal Video when needed.

  • New Features

    • Toggle in Event Setup to enable per-host locations for round-robin.
    • Host-by-host location picker with mass-apply, organizer input dialogs, and app availability badges.
    • Disables the global Locations picker and hides the public location list when per-host locations are enabled.
    • Booking service uses the organizer host’s location, auto-links a matching credential, and falls back to Cal Video when needed.
    • TRPC endpoints to load hosts with current location and installed apps, and to mass-apply a location.
    • Persists locations via a new HostLocation model and the enablePerHostLocations flag.
  • Migration

    • Adds EventType.enablePerHostLocations and creates HostLocation table and indexes.
    • Run database migrations; no manual steps required.

Written for commit 93d41bf. Summary will update on new commits.

@github-actions github-actions bot added the ❗️ migrations contains migration files label Dec 16, 2025
@vercel
Copy link

vercel bot commented Dec 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
cal-companion Error Error Dec 18, 2025 2:44pm
2 Skipped Deployments
Project Deployment Review Updated (UTC)
cal Ignored Ignored Dec 18, 2025 2:44pm
cal-eu Ignored Ignored Dec 18, 2025 2:44pm

@github-actions
Copy link
Contributor

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions bot added the Stale label Dec 26, 2025
Copy link
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Early review

@github-actions github-actions bot removed the Stale label Jan 9, 2026
@keithwillcode keithwillcode added the core area: core, team members only label Jan 10, 2026
@github-actions github-actions bot added enterprise area: enterprise, audit log, organisation, SAML, SSO High priority Created by Linear-GitHub Sync labels Jan 11, 2026
@Udit-takkar Udit-takkar marked this pull request as ready for review January 12, 2026 14:12
@Udit-takkar Udit-takkar requested review from a team as code owners January 12, 2026 14:12
@graphite-app graphite-app bot requested a review from a team January 12, 2026 14:13
@github-actions
Copy link
Contributor

Devin AI is resolving merge conflicts

This PR has merge conflicts with the main branch. A Devin session has been created to automatically resolve them.

View Devin Session

Devin will:

  1. Merge the latest main into this branch
  2. Resolve any conflicts intelligently
  3. Run lint/type checks to ensure validity
  4. Push the resolved changes

If you prefer to resolve conflicts manually, you can close the Devin session and handle it yourself.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 16 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/features/eventtypes/components/locations/HostLocations.tsx">

<violation number="1" location="packages/features/eventtypes/components/locations/HostLocations.tsx:479">
P1: Mass apply sets location types that require organizer input without saving the required link/address/phone value, so hosts end up with invalid locations.</violation>
</file>

<file name="packages/trpc/server/routers/viewer/eventTypes/heavy/update.handler.ts">

<violation number="1" location="packages/trpc/server/routers/viewer/eventTypes/heavy/update.handler.ts:604">
P2: Host location deletions run before the parent eventType update, so a failure in the subsequent update leaves hostLocation rows permanently deleted while the host update rolls back. Perform the deletions within the same transaction (or as nested deletes inside `data.hosts`) so the operations remain atomic.</violation>
</file>

<file name="packages/features/eventtypes/lib/types.ts">

<violation number="1" location="packages/features/eventtypes/lib/types.ts:37">
P2: Use the existing `EventLocationType["type"]` union for `HostLocation.type` so only supported location identifiers can be assigned, maintaining compile-time validation like the rest of the location models.</violation>
</file>

<file name="packages/features/bookings/lib/service/RegularBookingService.ts">

<violation number="1" location="packages/features/bookings/lib/service/RegularBookingService.ts:1314">
P1: Rule violated: **Avoid Logging Sensitive Information**

Remove the host’s address from the tracing logger payload to avoid leaking PII in logs.</violation>

<violation number="2" location="packages/features/bookings/lib/service/RegularBookingService.ts:1320">
P1: Rule violated: **Avoid Logging Sensitive Information**

Remove the organizer’s phone number from the tracing log to prevent leaking PII.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Resolved merge conflicts:
- apps/web/modules/event-types/components/tabs/setup/EventSetupTab.tsx: Updated imports to use new paths
- packages/trpc/server/routers/viewer/eventTypes/types.ts: Merged hostLocationSchema and enablePerHostLocations

Additional type fixes:
- Added location field to host fallback objects in roundRobinReassignment.ts and roundRobinManualReassignment.ts
- Updated getHostsWithLocationOptions.handler.ts to use credentialForCalendarServiceSelect
- Added enablePerHostLocations to defaultEvents.ts commons object

Co-Authored-By: unknown <>
devin-ai-integration bot and others added 4 commits January 15, 2026 13:19
Change scheduleId handling for existing hosts from 'host.scheduleId ?? null'
to 'host.scheduleId === undefined ? undefined : host.scheduleId' so that
when the client doesn't provide a scheduleId, the existing value is preserved
instead of being cleared to null.

Co-Authored-By: unknown <>
Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my previous feedback @Udit-takkar. I just see prisma queries in packages/trpc/server/routers/viewer/eventTypes/massApplyHostLocation.handler.ts. Let's move these to a repository before approving.

@github-actions github-actions bot marked this pull request as draft January 15, 2026 17:26
@Udit-takkar Udit-takkar marked this pull request as ready for review January 15, 2026 21:22
@Udit-takkar Udit-takkar added this to the v6.2 milestone Jan 15, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 issues found across 33 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/trpc/server/routers/viewer/eventTypes/getHostsWithLocationOptions.schema.ts">

<violation number="1" location="packages/trpc/server/routers/viewer/eventTypes/getHostsWithLocationOptions.schema.ts:4">
P2: `eventTypeId` should be constrained to an integer to match the DB identifier type. Accepting decimals can slip invalid IDs through the schema and break the resolver.</violation>

<violation number="2" location="packages/trpc/server/routers/viewer/eventTypes/getHostsWithLocationOptions.schema.ts:6">
P2: Ensure `limit` is an integer to keep pagination counts valid and predictable.</violation>
</file>

<file name="packages/trpc/server/routers/viewer/eventTypes/heavy/update.handler.ts">

<violation number="1" location="packages/trpc/server/routers/viewer/eventTypes/heavy/update.handler.ts:607">
P2: Host locations are deleted before the event type update runs, so any later validation error leaves hosts with their locations removed even though the update failed. Defer this delete until after the update succeeds or wrap it in the same transaction so the operation is atomic.</violation>
</file>

<file name="apps/web/modules/event-types/components/locations/HostLocations.tsx">

<violation number="1" location="apps/web/modules/event-types/components/locations/HostLocations.tsx:334">
P2: Opening the organizer-input dialog for a different location type reuses the previous location’s saved value because the dialog’s `initialValue` is always derived from `currentLocation`. This pre-fills the dialog with stale/invalid data when switching types.</violation>
</file>

<file name="apps/web/public/static/locales/en/common.json">

<violation number="1" location="apps/web/public/static/locales/en/common.json:4286">
P3: Add singular/plural translations for `location_applied_to_hosts` so "1 host" doesn’t render as "1 hosts".</violation>
</file>

<file name="packages/features/bookings/lib/handleNewBooking/test/per-host-locations.test.ts">

<violation number="1" location="packages/features/bookings/lib/handleNewBooking/test/per-host-locations.test.ts:481">
P2: Limit the Prisma query to the `credentialId` field instead of fetching all columns for `hostLocation`.

(Based on your team's feedback about selecting only the required fields in Prisma queries.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

devin-ai-integration bot and others added 3 commits January 15, 2026 21:32
Addresses Cubic AI review feedback (confidence 9/10) to fix '1 hosts' rendering as '1 host' by using i18next plural format with _one and _other suffixes.

Co-Authored-By: unknown <>
Copy link
Member

@Udit-takkar I think we should remove the locations that require Booker Input from the custom host location dropdown for now. This is because those locations require Booking Questions to be updated so that we can show an input field there. It doesn't work right now with custom host locations

Copy link
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is just one blocking feedback. We should use UUID data type for id column

organizerOrFirstDynamicGroupMemberDefaultLocationUrl = result.organizerDefaultLocationUrl;
perHostCredentialId = result.perHostCredentialId;

tracingLogger.info("Using per-host location", {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a lot of logs in production, this should probably be debug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we can't see debug logs on axiom

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just org only feature so there won't be that many logs

@github-actions github-actions bot marked this pull request as draft January 16, 2026 11:44
@Udit-takkar Udit-takkar marked this pull request as ready for review January 16, 2026 15:45
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 33 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/trpc/server/routers/viewer/eventTypes/massApplyHostLocation.schema.ts">

<violation number="1" location="packages/trpc/server/routers/viewer/eventTypes/massApplyHostLocation.schema.ts:4">
P2: `eventTypeId` should be validated as an integer ID to avoid accepting fractional values that will later break the Prisma query.</violation>
</file>

<file name="apps/web/modules/event-types/components/locations/HostLocations.tsx">

<violation number="1" location="apps/web/modules/event-types/components/locations/HostLocations.tsx:760">
P1: Mass apply overwrites each host’s location with `credentialId: null`, so integration-based locations (Zoom, Teams, etc.) lose the required credential and booking will fail after saving.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

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

Labels

core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO High priority Created by Linear-GitHub Sync ❗️ migrations contains migration files size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom host locations for Collective & Round Robin events

8 participants