Commit Graph
16382 Commits
Author SHA1 Message Date
Pedro CastroandGitHub cbb234cb35 fix: validate credential ownership in attribute sync update (#28873) 2026-04-14 08:29:26 -03:00
Pedro CastroandGitHub 51e852f671 refactor: narrow user fields returned by dynamic event endpoint (#28875) 2026-04-14 08:29:10 -03:00
053fb56b79 refactor: use named import for authedOrgAdminProcedure in dsync routers (#28877)
Co-authored-by: Sahitya Chandra <sahityajb@gmail.com>
2026-04-14 05:41:25 +00:00
Pedro CastroandGitHub a657723e1c fix: add session and permission checks to webhook settings page (#28769) 2026-04-14 00:46:46 -03:00
Sahitya ChandraandGitHub 2911168e4e fix(security): upgrade axios to 1.15.0 to fix critical CVEs (#28850)
Upgrades axios from 1.13.5 to 1.15.0 in apps/api/v2 and the root
resolutions field to resolve two critical vulnerabilities:

- GHSA-3p68-rc4w-qgx5: NO_PROXY hostname normalization bypass leading to SSRF
- GHSA-fvcv-3m26-pcqx: Unrestricted cloud metadata exfiltration via header injection

Both CVEs are fixed in axios >=1.15.0.
2026-04-12 15:15:42 -03:00
Akash SantraandGitHub d08f4a0215 docs: fix grammar, formatting and clarity issues in docs (#28832) 2026-04-11 05:38:16 +00:00
f3e07c5223 chore(member-invite): early return for pending mutations while copying invite link (#28753)
* chore(member-invite): early return for pending mutations while copying invite link

* typo fix

* make rabbit happy

---------

Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
2026-04-08 23:45:20 +05:30
Sahitya ChandraandGitHub dcbb417aec fix: use Proxy-based CalendarServiceMap mock to prevent test flakes (#28787)
* fix: add vi.mock calls to prevent InstantBookingCreateService test flake

Add two vi.mock() calls ported from cal repo to prevent
'Closing rpc while fetch was pending' errors:

1. Mock @calcom/app-store/calendar.services.generated with a Proxy
   to prevent real calendar modules (feishu, lark) from triggering
   async getAppAccessToken fetch calls during test worker shutdown.

2. Mock @calcom/features/ee/organizations/di/OrganizationRepository.container
   to prevent deep transitive import chain from triggering a Vitest
   module-resolution RPC still in flight at shutdown.

Also removes the narrow feishucalendar mock which is now covered by
the broader calendar.services.generated Proxy mock.

* fix: update bookingScenario to use Proxy-based CalendarServiceMap

Replace the plain-object CalendarServiceMap mock with a Proxy-based
implementation that catches ALL calendar service accesses. This prevents
real calendar modules (feishu, lark, etc.) from being imported during
tests, which was causing 'Closing rpc while fetch was pending' errors
when the Vitest worker shut down.

Also update mockCalendar to use a shared mock map directly instead of
dynamically importing calendar.services.generated, avoiding loading
real calendar service modules during test execution.
2026-04-08 13:17:30 +05:30
77eb4c80bf fix(ci): pin lingodotdev/lingo.dev action to SHA to prevent supply chain risk (#28774)
Signed-off-by: Mendral Agent <support@mendral.com>
Co-authored-by: Mendral Agent <support@mendral.com>
2026-04-08 06:44:21 +00:00
3c52f57231 fix: prevent negative wait time in rate limit error message (#28765)
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
2026-04-07 18:27:44 +00:00
Abhishek SaxenaandGitHub cdeaca4dc2 fix(web): add vertical padding to social login buttons (#28767) 2026-04-07 18:17:46 +00:00
54f36af943 fix(tests): add missing vi.mock() to prevent vitest worker shutdown flake in InstantBookingCreateService (#28773)
Signed-off-by: Mendral Agent <support@mendral.com>
Co-authored-by: Mendral Agent <support@mendral.com>
2026-04-07 18:13:17 +00:00
RomitGitHubromitgabani1shockzM1PaperclipClaude Opus 4.5Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
facc0745d3 fix(docs): correct self-hosting troubleshooting guide based on codebase verification (#28756)
* docs: add self-hosting troubleshooting guide

Add a dedicated troubleshooting page (docs/self-hosting/troubleshooting.mdx)
covering the most common self-hosting issues:

- 500 error during onboarding caused by missing STRIPE_PRIVATE_KEY (#25993)
- Redirect to localhost after deployment (NEXTAUTH_URL / NEXT_PUBLIC_WEBAPP_URL) (#21921)
- API v2 service not starting in Docker (missing REDIS_URL, JWT_SECRET, WEB_APP_URL)
- CLIENT_FETCH_ERROR in Docker logs
- SSL issues behind a reverse proxy
- Prisma user creation failure on first setup

Also adds the new page to the "Getting Started" navigation group in docs/docs.json.

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* fix(docs): provide safer SSL troubleshooting alternatives

Replace the blanket NODE_TLS_REJECT_UNAUTHORIZED=0 recommendation
with three options in order of preference:
1. Use HTTP internally with proper header forwarding
2. Add internal CA to NODE_EXTRA_CA_CERTS
3. Disable TLS verification (last resort with security warning)

The previous guidance could expose users to MITM attacks on all
external API calls (Stripe, Google, etc.).

* fix(docs): correct NEXTAUTH_URL guidance to prevent OAuth breakage

The previous guidance recommended setting NEXTAUTH_URL to localhost
for SSL/DNS issues, which breaks OAuth callbacks since external
providers would redirect to localhost instead of the public domain.

- Replace localhost workaround with extra_hosts in docker-compose
- Add nginx proxy header configuration example
- Add warnings explaining why localhost breaks OAuth

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(docs): correct troubleshooting guide based on codebase verification

- Stripe section: Rewrite to accurately reflect current behavior (app
  gracefully handles missing keys by marking Stripe as 'not installed'
  rather than crashing). Clarify that NEXT_PUBLIC_STRIPE_PUBLIC_KEY
  belongs in .env.appStore.
- API v2 section: Add missing required vars (STRIPE_API_KEY,
  STRIPE_WEBHOOK_SECRET, NEXTAUTH_SECRET) that crash the service if
  absent. Move WEB_APP_URL to optional (it has a fallback default).
- CLIENT_FETCH_ERROR section: Add caveat about HTTPS URLs failing
  with the extra_hosts approach when app listens on port 3000.
- Vercel note: Clarify that NEXTAUTH_URL is auto-inferred via
  VERCEL_URL, not just 'left empty'.
- Database section: Replace unverifiable metadata/id advice with
  actionable migration and setup guidance matching actual code in
  apps/web/app/api/auth/setup/route.ts.

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

* docs: fix inaccuracies in self-hosting troubleshooting guide

- Add missing CALENDSO_ENCRYPTION_KEY to API v2 required variables
- Fix setup endpoint path from /api/auth/setup to /auth/setup
- Add note about NEXTAUTH_URL auto-derivation from NEXT_PUBLIC_WEBAPP_URL

* fix(docs): correct NEXTAUTH_URL derivation mechanism description

NextAuth infers the base URL from the request's Host header when
NEXTAUTH_URL is not set, not from NEXT_PUBLIC_WEBAPP_URL directly.

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

---------

Co-authored-by: shockzM1 <shockz@dsn.so>
Co-authored-by: Paperclip <noreply@paperclip.ing>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-04-06 18:08:46 +05:30
Yuvraj Angad SinghGitHubbot_apkHariom BalharaDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>hariom@cal.com <hariombalhara@gmail.com>Claude Opus 4.6
25857c07e1 feat(bookings): add booking audit logging to instant bookings (#28176)
* feat(bookings): add booking audit logging to instant bookings

wire up BookingEventHandlerService.onBookingCreated in
InstantBookingCreateService to emit audit events, matching the
pattern already used in RegularBookingService and
RecurringBookingService.

* refactor: extract fireBookingEvents and reuse existing orgId

* refactor: derive orgId once and pass to both webhook trigger and audit event

* fix: add missing return in webhook map callback

* refactor: make creationSource required for instant bookings

Both callers (WEBAPP and API_V2) always set creationSource, so validate
it upfront and use CreationSource enum type instead of string | null.

* fix: use ErrorWithCode instead of Error, pass userUuid to audit events

* fix: pass null for hostUserUuid in instant booking audit data

Instant bookings have status AWAITING_HOST with no assigned host,
so the booker's UUID should not be recorded as hostUserUuid.

* fix: address devin review - hostUserUuid and creationSource validation

* fix: address review - bookingMeta, getOrgIdFromMemberOrTeamId, required creationSource

- pass userUuid via bookingMeta instead of separate param (matches RegularBookingService pattern)
- restore getOrgIdFromMemberOrTeamId for proper org resolution instead of eventType.team.parentId
- make creationSource required with runtime validation instead of defaulting to WEBAPP

* fix: enforce creationSource at compile time instead of runtime

use Required<Pick<>> to make creationSource required in the type
signature. removes the runtime check since TypeScript catches
missing creationSource at build time.

* fix: simplify type signature and derive hostUserUuid from booking relation

- Replace Required<Pick<CreateInstantBookingData, 'creationSource'>> with inline { creationSource: CreationSource }
- Include user relation in booking create query to derive hostUserUuid
- Pass newBooking.user?.uuid instead of hardcoding null for userUuid in audit data

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* chore: trigger CI

* fix: add missing impersonatedByUserUuid to instant booking meta

The CreateBookingMeta type requires impersonatedByUserUuid. Set it to
null for non-impersonated instant bookings.

* fix: show 'awaiting host' in audit log for instant bookings

Use booking status AWAITING_HOST to display "Booked (awaiting host)"
instead of "Booked with Unknown" when no host has accepted yet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add booking audit for instant meeting accept via connect-and-join

Extract fireInstantBookingAcceptedAuditEvent to InstantBookingCreateService
and fire it right after the DB update, before side-effect notifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add audit logging tests for instant booking creation

* fix: simulate audit failure in resilience test (identified by cubic)

The test 'should not throw when booking audit event fails' was not
actually simulating an audit failure. Added vi.spyOn on
BookingEventHandlerService.prototype.onBookingCreated to reject with
an error, and assert the spy was called, proving the try/catch in
fireBookingEvents properly catches the error without breaking the
booking flow.

Co-Authored-By: bot_apk <apk@cognition.ai>

* test: add audit event tests for connectAndJoin and fix InstantBooking audit test

* test

---------

Co-authored-by: Hariom Balhara <1780212+hariombalhara@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: hariom@cal.com <hariombalhara@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: bot_apk <apk@cognition.ai>
2026-04-04 13:30:03 -03:00
c7ee77ee20 test: improve matchUserToMatchingOrg coverage (#28721)
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
2026-04-03 23:47:56 +05:30
e4aff2db45 feat: add Signal to conferencing category (#28724)
Co-authored-by: Sahitya Chandra <sahityajb@gmail.com>
2026-04-03 13:00:56 +00:00
Adarsh SinghandGitHub aeede9b88c fix: correct Russian translation typo in booking form (#28719)
- Fix typo in 'what_is_this_meeting_about' translation
- Change 'посвязена' to 'посвящена' (correct Russian spelling)
- Verified with type-check:ci --force
2026-04-03 06:27:34 +00:00
Keith WilliamsGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
c106740d17 fix: skip lingo.dev i18n automation when API key is not set (#28704)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-04-01 18:37:15 -03:00
Pedro CastroandGitHub 9b3bbb9f72 fix: unify webhook ID resolution across handlers (#28701) 2026-04-01 16:29:55 -03:00
Pedro CastroandGitHub 2e5643e192 fix: escape special characters in Salesforce SOQL queries (#28700) 2026-04-01 16:29:14 -03:00
Keith WilliamsGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
82ccdc8e0c refactor: remove Devin GitHub Action integrations and DEVIN_API_KEY references (#28703)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-04-01 13:21:03 -03:00
Sahitya ChandraandGitHub 77b2be13b2 fix: resolve flaky 'Book on column layout' E2E test (#28682)
In column view, time slots are always visible. selectFirstAvailableTimeSlotNextMonth
could click stale time slots from the current month before the schedule data refreshed
for the new month. Since isQuickAvailabilityCheckFeatureEnabled is always true in E2E,
isTimeSlotAvailable would check the stale slot against the new month's schedule data,
find no match, and permanently disable the confirm button.

Fix: wait for initial schedule data to load before setting up a waitForResponse listener
for getSchedule, then click incrementMonth and await the response before selecting slots.

Ported from calcom/cal#1107.
2026-03-31 20:04:15 +05:30
BEK Service GmbHGitHubdevin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>Sahitya Chandradevin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>Dhairyashil Shinde
78ddc1b2ae feat: add Famulor app integration to app store (#25857)
* Add Famulor app integration to app store

Introduces the Famulor app as a new automation integration in the app store, including configuration, API handler, assets, and documentation. Updates redirectApps utility to include 'famulor' for redirection support.

* fixed - famulor

* Update packages/app-store/famulor/api/add.ts

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Update packages/app-store/famulor/config.json

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* yarn app-store:build

---------

Co-authored-by: Sahitya Chandra <sahityajb@gmail.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com>
2026-03-31 06:54:09 -03:00
KayandGitHub e38cbdad85 Add DeepWiki badge to README (#28679)
Added a badge for DeepWiki to the README.
2026-03-31 07:49:56 +00:00
f7b2f2762c fix(api-v2): correctly parse ISO timezone offsets when rescheduling bookings (#28333)
* fix(api-v2): correctly parse ISO timezone offsets when rescheduling bookings

closes: #28310

* fix: clarify reschedule endpoint requires UTC timezone

Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>

---------

Signed-off-by: Hemant M Mehta <hemant29mehta@gmail.com>
Co-authored-by: Rajiv Sahal <sahalrajiv-extc@atharvacoe.ac.in>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Sahitya Chandra <sahityajb@gmail.com>
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
2026-03-30 11:35:02 +00:00
ae01092258 fix: use i18n for apps count with proper pluralization (#28479)
* fix: use i18n for apps count with proper pluralization

Replace hardcoded "${installedAppsNumber} apps" with
t("number_apps", { count: installedAppsNumber }) for proper
i18n pluralization support. Removes the TODO comment that
flagged this issue.

Closes #28407

* fix: update e2e test to match i18n singular/plural apps count

---------

Co-authored-by: Sahitya Chandra <sahityajb@gmail.com>
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
2026-03-30 12:31:11 +01:00
RomitGitHubromitgabani1Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
96d78a03d2 fix: add deterministic ordering to attendee queries in booking-seats e2e tests (#28672)
* fix: add deterministic ordering to attendee queries in booking-seats e2e tests

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

* fix: revert secondAttendeeSeat change, keep original references query per review feedback

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-30 16:23:49 +05:30
3b4eef12a0 docs: update Docker self-hosting documentation (#28647)
- Fix Advanced users section: update "Clone calcom/docker" reference to
  "calcom/cal.com" and remove outdated submodule update step
- Add required secret key generation instructions for NEXTAUTH_SECRET
  and CALENDSO_ENCRYPTION_KEY in the Docker setup steps
- Add Calendar integration skip guidance for first-time users who get
  stuck on the "Connect your Calendar" setup wizard step
- Update runtime variables table with generation commands for secrets

Fixes #24833

Co-authored-by: shockzM1 <shockz@dsn.so>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-03-29 08:50:36 +00:00
RomitGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
31f40764da fix: stabilize flaky E2E booking sheet tests by waiting for button visibility (#28631)
Both booking-sheet-keyboard.e2e.ts and bookings-list.e2e.ts intermittently
timeout in CI when clicking the booking item button before the DOM has
finished rendering. Adding explicit waitFor({ state: 'visible' }) on the
role=button element after the parent booking item is visible ensures the
click target is fully ready.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-28 11:37:55 -03:00
RomitGitHubromitgabani1Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
0f4717e0be fix: mock @calcom/lib/i18n in EventManager.test.ts to prevent vitest worker shutdown flake (#28630)
* fix: mock @calcom/lib/i18n in EventManager.test.ts to prevent vitest worker shutdown flake

TranslationService transitively imports @calcom/lib/i18n which triggers slow
module resolution via vite's RPC. When the vitest worker shuts down before it
completes, it causes 'Closing rpc while fetch was pending' errors.

Mocking the module prevents the actual module resolution during test loading.

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

* chore: remove explanatory comments per review feedback

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-28 11:37:18 -03:00
ad791f8ea5 fix: block localhost and loopback addresses in SSRF protection (#28622)
* fix: block localhost and loopback addresses in SSRF protection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: block loopback IPs by hostname in SSRF protection

Add 127.0.0.1, ::1, [::1], and 0.0.0.0 to blocked hostnames list for
defense-in-depth protection against SSRF attacks targeting localhost.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Romit <romitgabani1.work@gmail.com>
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
2026-03-28 13:21:58 +00:00
fbf6510dd8 fix: join Reply-To addresses as string for SMTP compatibility (#28611)
* fix: join multiple Reply-To addresses as comma-separated string

Some SMTP providers (e.g., SendLayer) reject emails when Reply-To is
passed as an array to nodemailer, which serializes it as multiple
Reply-To headers. Using a comma-joined string is RFC 2822 compliant
and works universally across all SMTP providers.

Fixes #28610

* test: add unit tests for getReplyToHeader SMTP compatibility

- Verify replyTo is always returned as comma-separated string, not array
- Test single email, multiple emails, and empty email cases
- Add RFC 5322 compliance test for SMTP compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add RFC 5322 reference comment to getReplyToHeader tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Lawrence Christian <67164412+LCNDevs@users.noreply.github.com>
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
Co-authored-by: Romit <romitgabani1.work@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 13:08:52 +00:00
RomitGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
d80493f201 fix: resolve flaky API v2 slots-2024-04-15 E2E tests (#28589)
- Add await to unawaited bookingSeatsRepositoryFixture.create calls
- Clean up leftover selected slots before seated event tests

The flakiness was caused by two issues:
1. Missing await on bookingSeatsRepositoryFixture.create() - the HTTP
   request to fetch slots could execute before the booking seat record
   was written to the database, leading to incorrect seat counts.
2. Leftover SelectedSlots records leaking between test groups - the
   availability calculation fetches all unexpired reserved slots by
   userId (not eventTypeId), so reserved slots from earlier tests
   appeared as busy times when computing slots for seated event types.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-28 14:52:01 +05:30
Yadong (Adam)andGitHub d6852783b4 fix(apps/web): update digitClassName in VerifyCodeDialog for improved dark mode styling (#28623) 2026-03-28 08:49:58 +00:00
RomitGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
56099f0107 fix: add missing vi.mock() calls to parseFrontmatter test to prevent vitest worker shutdown flakiness (#28626)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-28 14:18:49 +05:30
a42b51051e fix: improve German translation for reschedule button #28607 (#28624)
* fix: improve German translation for reschedule button

* fix: use accurate German translation for reschedule button

Change "Neuen Termin buchen" (Book new appointment) to "Neu terminieren"
(Re-schedule) to align with the English "Reschedule" meaning.

---------

Co-authored-by: Romit <romitgabani1.work@gmail.com>
2026-03-28 08:48:11 +00:00
RomitGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
0936fdafaf fix: upgrade handlebars to 4.7.9 to resolve critical vulnerability (#28625)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-28 17:01:18 +09:00
Sahitya ChandraandGitHub 2fc630ed92 fix: mock delegationCredential in getRoutedUsers test to prevent flaky worker shutdown errors (#28603)
* fix: mock delegationCredential in getRoutedUsers test to prevent flaky worker shutdown errors

The getRoutedUsers.test.ts file only tests the pure sync function
getRoutedUsersWithContactOwnerAndFixedUsers, but importing getRoutedUsers.ts
triggers a heavy transitive import chain:

  getRoutedUsers.ts
  -> @calcom/app-store/delegationCredential
  -> _utils/getCalendar
  -> calendar.services.generated (all calendar services)
  -> CalendarService.ts -> ics/tsdav

Sometimes the vitest worker finishes tests and shuts down before all async
module resolution completes, causing:
  Error: [vitest-worker]: Closing rpc while "fetch" was pending

Mock @calcom/app-store/delegationCredential to cut off the import chain
since the tested function doesn't use it.

* Clean up comments in getRoutedUsers.test.ts

Removed comments about mocking delegationCredential to improve code clarity.
2026-03-27 08:54:29 -03:00
Sahitya ChandraandGitHub b436f331c7 fix: guard against document being undefined in embed-iframe informAboutScroll (#28596)
* fix: guard against document being undefined in informAboutScroll to fix flaky test

* fix: update comment to not reference test environment
2026-03-27 11:50:35 +00:00
15005d89bd fix(auth): implement proper debounce ref for forgot password requests (#28490)
* fix(auth): implement proper debounce ref for forgot password requests

* Add cleanup for debounced submit function

Cancel debounced function on component unmount.

---------

Co-authored-by: javidan <javababayev@gmail.com>
Co-authored-by: Sahitya Chandra <sahityajb@gmail.com>
2026-03-27 14:44:59 +05:30
RomitGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
87fb2abf59 fix: scope cleanup query in managedEventReassignment test to prevent cross-file interference (#28587)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-26 15:48:55 +05:30
RomitGitHubromitgabani1Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
fb3ab660e1 fix: stabilize flaky Team filter E2E tests in bookings-list (#28576)
* fix: stabilize flaky Team filter E2E tests in bookings-list

Backport fix from calcom/cal: replace fragile expect.poll().toBe(1)
with explicit toBeHidden() wait for filtered-out booking item followed
by toHaveCount(1). This prevents race conditions where the DOM hasn't
updated yet after the team filter API response returns.

Fixes all three Team filter tests:
- Team filter shows bookings for direct team event types
- Team filter shows bookings for managed event types (child events)
- Team filter excludes bookings from other teams

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

* fix: adjust direct team event types test assertion

In cal.com, the team filter includes personal bookings of team members,
so instead of asserting the personal booking is hidden, verify that the
team booking is visible and present. The managed event types and
cross-team tests correctly use toBeHidden since those filters do
exclude the expected items.

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

* fix: strengthen direct team event types assertion with filter-active check

Add assertion that the teamId filter popover trigger is visible in the UI,
proving the filter was applied before checking the team booking is present.
This addresses the concern that toBeVisible alone would pass even without
the filter being active.

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

* chore: remove comments per review feedback

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-25 14:34:42 +05:30
RomitGitHubromitgabani1Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
e073cbd5ea fix: resolve flaky team-management E2E test (#28575)
* fix: resolve flaky team-management E2E test

Fix two failure modes in the 'Can create teams via Wizard' test:

1. Strict mode violation: locator('[data-testid=new-team-btn]') resolves to
   2 elements during Next.js streaming/hydration. Fixed by using .first().

2. Race condition in disband assertion: raw .count() check doesn't wait for
   UI to update after team deletion. Replaced with Playwright's auto-retrying
   toBeHidden() assertion with a 10s timeout.

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

* chore: remove explanatory comments per review feedback

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-25 14:19:35 +05:30
ecc5e66fd4 fix(e2e): replace false-passing assertions and hard-coded waits in test suite (#28486)
* fix(e2e): replace always-passing assertions and hard-coded waits

- Replace toBeTruthy() on Locator objects with toBeVisible() (always-passing)
- Replace toBeTruthy() on boolean expressions with toBe(true) for clarity
- Replace hardcoded waitForTimeout() with element-based waits (waitFor/toBeVisible)
- Fix strict mode violation: getByTestId("away-emoji").first()
- Fix error assertion: infinite redirect error shown as toast → getByTestId("toast-error")
- Fix isDisabled() no-op → await expect().toBeDisabled() in workflows fixture
- Fix alby setup: add waitForURL(), remove unverifiable "Connect with Alby" assertion
- Fix stripe/paypal: replace no-op isDisabled() with toBeChecked() on paypal switch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(e2e): fix stale comment in stripe price test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(e2e): address cubic review feedback on assertion patterns

- workflows.ts: replace non-retrying isDisabled() snapshot with toBeDisabled()
- out-of-office.e2e.ts: add .first() for away-emoji strict mode, use toast-error testid, remove unused const t
- payment-apps.e2e.ts: replace always-passing toBeTruthy() with toHaveURL() assertion

* fix

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
Co-authored-by: Romit <romitgabani1.work@gmail.com>
2026-03-25 05:25:49 +00:00
a3baf493eb fix(calendar): add pointer cursor to enabled date buttons (#28534)
Co-authored-by: Pranav Gawande <pranavv00@users.noreply.github.com>
Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
2026-03-25 04:41:53 +00:00
Alex van AndelGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
806fd8edd0 fix: prevent IDOR in PBAC updateRole and deleteRole tRPC endpoints (#28569)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-25 03:38:35 +05:30
RomitGitHubbot_apkDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>Alex van Andel
ee973c6661 fix: harden seed script org settings upsert and P2002 error handling (#28527)
* fix: harden seed script org settings upsert and P2002 error handling

Co-Authored-By: romitgabani1 <romitgabani1.work@gmail.com>

* fix: remove PII from P2002 log and recover existing user instead of returning null

- Replace username interpolation in log message with generic text (Cubic violation #2, confidence 9/10)
- On P2002, fetch the existing user from DB and return it with membership data instead of returning null, which was dropping users from org setup on retries (Cubic violation #3, confidence 9/10)

Co-Authored-By: bot_apk <apk@cognition.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: bot_apk <apk@cognition.ai>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
2026-03-24 21:43:50 +00:00
Alex van AndelGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
e9e96671bd fix: remove shared pbac feature flag deletion from e2e test cleanup (#28573)
The afterAll hooks in PBAC-related e2e specs were deleting the global
'pbac' feature definition via featuresRepositoryFixture.deleteBySlug().
When multiple test suites run in parallel, one suite's cleanup would
delete the feature while other suites still depend on it, causing
intermittent failures.

Each test already creates its own team-level feature flag association
and cleans that up correctly. The global feature definition does not
need per-suite deletion and is better left intact to avoid cross-suite
interference.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-24 21:35:13 +00:00
Sahitya ChandraGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
b46c04da87 fix(form-builder): show default label when field label is only whitespace (#27793)
* fix(form-builder): show default label when field label is only whitespace

* fix: add validation to ensure label is not empty or whitespace

* fix: enhance label validation to prevent empty or whitespace labels in FormBuilder

* fix: refactor label validation in FormBuilder to streamline whitespace checks

* chore: retrigger CI (flaky vitest worker shutdown)

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-03-22 21:34:23 +05:30
Hariom BalharaGitHubbot_apkDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
dc43eba23b feat: add Move Team to Organization admin migration page (#25067)
* feat: restore moveTeamToOrg admin endpoint for organization migration

- Add moveTeamToOrg and removeTeamFromOrg functions to orgMigration.ts
- Restore API endpoint at /api/orgMigration/moveTeamToOrg
- Restore admin UI page at /settings/admin/orgMigrations/moveTeamToOrg
- Add helper functions for team redirect management
- Support moving team members along with the team

This endpoint allows admins to migrate teams to organizations after org creation,
which is needed as a temporary solution until proper org admin permissions are implemented.

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* fix: move moveTeamToOrg to lib/orgMigration and fix redirect URL

- Move moveTeamToOrg and removeTeamFromOrg functions from playwright/lib to lib/orgMigration.ts
- Update API endpoint to import from lib/orgMigration instead of playwright/lib
- Fix redirect URL format: use / instead of /team/
- Fix import path: use ../playwright/lib/orgMigration instead of ./playwright/lib/orgMigration
- Rename unused _dbRemoveTeamFromOrg in playwright file to satisfy linter
- Remove duplicate functions from playwright/lib/orgMigration.ts

This fixes the Vercel deployment failure caused by importing from test-only directories
in production API routes, and corrects the redirect URL format to match the original implementation.

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* refactor: reuse existing createTeamsHandler for moveTeamToOrg endpoint

- Remove custom orgMigration.ts implementation
- Update API endpoint to call existing createTeamsHandler with org owner impersonation
- Remove moveMembers option from UI (always moves members by design)
- Fix Vercel deployment by removing playwright import from production code
- Use OrganizationRepository.adminFindById to fetch org owner

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* refactor: migrate moveTeamToOrg admin page and API to App Router

- Move admin page from pages/settings/admin/orgMigrations to app/(use-page-wrapper)/settings/(admin-layout)/admin/orgMigrations
- Convert API route from pages/api/orgMigration/moveTeamToOrg.ts to app/api/orgMigration/moveTeamToOrg/route.ts
- Create client view component in modules/settings/admin/org-migrations/
- Remove old pages directory files and getServerSideProps

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* fix: correct import paths for App Router compatibility

- Fix @calcom/lib/server to @calcom/lib/server/i18n for getTranslation
- Fix @calcom/ui barrel import to specific component paths

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* fix: use TFunction type for getFormSchema parameter

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* fix: use buildLegacyRequest for App Router session compatibility

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* Remove unused fn

* cleanup

* cleanup

* fix: ui

* fix: handle slug conflict error when moving team to organization

- Intercept Prisma P2002 unique constraint error when moving a team
- Convert to user-friendly CONFLICT error with clear message
- Add test case for slug conflict scenario

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* fix: use isPending instead of isLoading for tRPC mutation

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* fixes

* fix: remove PII (emails) from admin log statement

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* refactor: use instanceof pattern for Prisma error detection

Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>

* fixes

* fix: use i18n key for slug conflict error message instead of hardcoded English string

Co-Authored-By: bot_apk <apk@cognition.ai>

* fix: narrow P2002 catch scope to only prisma.team.update call

Separates the try-catch for prisma.team.update (slug conflict) from
creditService.moveCreditsFromTeamToOrg to avoid misattributing credit
service P2002 errors as slug conflicts.

Co-Authored-By: bot_apk <apk@cognition.ai>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: bot_apk <apk@cognition.ai>
2026-03-19 09:55:02 +05:30