Keith WilliamsGitHubkeith@cal.com <keithwillcode@gmail.com>keith@cal.com <keithwillcode@gmail.com>keith@cal.com <keithwillcode@gmail.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* update
* Add cache-db action to e2e workflow
* fix: remove cache-db from prepare job (requires Postgres service)
The prepare job doesn't have a Postgres service container, so cache-db
was failing with 'connection refused' when trying to run psql.
cache-db should only run in the e2e shards which have the Postgres service.
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* update
* Update e2e.yml
* Add newline at end of e2e.yml file
* fix
* Fix indentation in e2e.yml for retention-days
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: lock package versions to exact versions from yarn.lock
Replace version ranges (^, ~) with exact resolved versions from yarn.lock
to ensure consistent dependency resolution across all environments.
This change affects 26 package.json files with 89 version updates including:
- TypeScript: ^5.9.0-beta -> 5.9.2
- Zod: ^3.22.4 -> 3.25.76
- React: ^18 -> 18.2.0
- Various Radix UI, Vite, PostCSS, and other dependencies
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: preserve npm alias format for @radix-ui packages
The previous commit incorrectly converted npm aliases like
'npm:@radix-ui/react-dialog@^1.0.4' to just '1.0.4', which broke
yarn install as it tried to find non-existent packages.
This fix restores the npm alias format while keeping the pinned versions:
- @radix-ui/react-dialog-atoms: npm:@radix-ui/react-dialog@1.0.4
- @radix-ui/react-tooltip-atoms: npm:@radix-ui/react-tooltip@1.0.6
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* refactor: move dev dependencies to devDependencies section
Move 26 dependencies that are clearly development-only to the
devDependencies section across 10 packages:
- Testing: @types/jest, jest, ts-jest, @golevelup/ts-jest
- Build tools: typescript, ts-node, concurrently, dotenv-cli
- Linting: eslint-*, eslint-config-*, eslint-plugin-*
- Types: @types/express, @types/turndown, @types/uuid
This improves dependency organization and ensures production builds
don't include unnecessary development dependencies.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
* Remove all links legacyBehavior
* fix: resolve type errors in Button and Dropdown when using Link without legacyBehavior
- Button.tsx: Only pass ref to button element, not to Link (Link manages its own anchor)
- Dropdown.tsx: Strip ref from props when using Link to avoid type incompatibility
This fixes the type errors that were causing API V1 and V2 builds to fail.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: only pass disabled and type props to button element, not to Link
Link component doesn't accept disabled or type props, so these should only be passed when rendering a button element.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: strip ref from passThroughProps when rendering Link
The passThroughProps spread was including a ref property that's incompatible with Link's expected ref type. This strips the ref when rendering a Link component.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: use type assertion for React.createElement props to handle union types
The Button component uses a union type for props that can be either Link or button props. TypeScript can't narrow the union type properly when using React.createElement with a dynamic element type, so we use a type assertion to cast the props to the correct type.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: render Link and button separately to avoid type conflicts
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: preserve data-testid when rendering Button as Link
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
---------
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* create an ios screen for specific native logic
* feat: update bookings layout to conditionally show header on iOS
* feat: add useActiveBookingFilter hook for managing booking filter state
- Introduced a new hook, useActiveBookingFilter, to manage the active booking filter state and provide related utilities.
- Added filter options for "upcoming", "unconfirmed", "past", and "cancelled" bookings.
- Updated index.ts to export the new hook and its types for UI state management.
* refactor: streamline booking filter management and remove unused code
- Integrated the useActiveBookingFilter hook to manage booking filter state, simplifying the filter logic.
- Removed redundant state variables and functions related to booking filters.
- Cleaned up the code by eliminating unused imports and commented-out code sections.
- Updated the booking fetching logic to utilize the new filter parameters directly.
* refactor: move meeting URL extraction and info retrieval to utility module
- Extracted meeting URL extraction and meeting info retrieval logic into a new utility module, meetings-utils.ts.
- Updated index.ios.tsx and index.tsx to utilize the new getMeetingInfo function from the utility module, simplifying the component code.
- Removed redundant helper functions from the component files to enhance maintainability.
* refactor: extract empty state content logic into utility module
- Moved the getEmptyStateContent function from the Bookings component files to a new utility module, bookings-utils.ts, to enhance code reusability and maintainability.
- Updated index.ios.tsx and index.tsx to utilize the new utility function, simplifying the component code and improving clarity.
- Removed redundant empty state logic from the component files.
* refactor: enhance booking filtering and utility functions
- Updated the Bookings component to utilize new utility functions for filtering bookings by event type and search queries, improving code clarity and maintainability.
- Moved formatting functions (formatTime, formatDate, formatMonthYear, getMonthYearKey) and grouping logic (groupBookingsByMonth) to the bookings-utils module, centralizing related functionality.
- Removed redundant code from the Bookings component files, streamlining the overall structure.
* refactor: implement booking actions hook for improved management
- Introduced a new `useBookingActions` hook to centralize booking-related actions such as rescheduling, confirming, and rejecting bookings, enhancing code organization and reusability.
- Updated the `Bookings` component to utilize the new hook, simplifying the component logic and reducing redundancy.
- Removed outdated state management and functions related to booking actions, streamlining the overall code structure.
* refactor: consolidate booking components and enhance structure
- Refactored the Bookings component to utilize a new BookingListScreen component, improving code organization and readability.
- Introduced BookingListItem for individual booking rendering, streamlining the rendering logic and enhancing maintainability.
- Removed redundant state management and functions from the Bookings component, simplifying the overall structure.
- Updated modal handling for booking actions, rescheduling, and rejection to improve user experience and code clarity.
* feat: add BookingListItem component for enhanced booking display
- Introduced a new BookingListItem component for rendering individual booking details, improving modularity and reusability.
- Implemented context menu actions for booking management, including rescheduling, editing location, and adding guests.
- Updated type definitions for BookingListItemProps to include additional action handlers for better functionality.
- Refactored existing BookingListItem component to utilize the new props structure, enhancing clarity and maintainability.
* refactor: simplify layout and styling in BookingListItem and BookingListScreen components
- Updated the BookingListItem component to streamline the layout by reducing padding and adjusting the gap between elements.
- Modified the BookingListScreen component to remove unnecessary horizontal padding in the content container style, enhancing the overall layout consistency.
2025-12-21 11:38:42 +00:00
Keith WilliamsGitHubkeith@cal.com <keithwillcode@gmail.com>keith@cal.com <keithwillcode@gmail.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>Dhairyashil Shinde
* refactor: import AppRouter from generated types instead of server source
This change improves tRPC build performance by having the client-side code
import AppRouter from pre-generated type declarations instead of traversing
the entire server router tree.
Changes:
- Create type bridge file at packages/trpc/types/app-router.ts
- Update packages/trpc/react/trpc.ts to import from the bridge
- Update .gitignore to only ignore types/server (generated files)
- Update eslint.config.mjs to only ignore types/server (generated files)
The type bridge provides:
1. Faster typechecking - avoids parsing 458 server files
2. Stable import location that's easy to lint against
3. Single place to adjust if generated path changes
Build order is already enforced in turbo.json (type-check depends on @calcom/trpc#build).
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: move bridge file to react/ to avoid TS5055 error
Move the AppRouter type bridge file from types/app-router.ts to react/app-router.ts
to avoid the TS5055 'Cannot write file because it would overwrite input file' error.
The issue was that placing the bridge file in types/ caused TypeScript to treat
the generated .d.ts files as input files during the tRPC build, then fail when
trying to emit to the same location.
By placing the bridge in react/ (which is excluded from the tRPC server build),
the bridge file is only used by client code and doesn't interfere with the
server type generation.
Changes:
- Move bridge file from types/app-router.ts to react/app-router.ts
- Update import in react/trpc.ts to use ./app-router
- Revert .gitignore to ignore all of types/ (generated files)
- Revert eslint.config.mjs to ignore all of types/**
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* refactor: split tRPC build into server and react phases
- Create tsconfig.server.json for server-only type generation
- Create tsconfig.react.json for react/client type generation
- Update build script to run server build first, then react build
- Remove || true so build properly fails on errors
- This allows react code to import from generated server types
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* refactor: split @calcom/trpc exports to separate server and react entrypoints
- Remove react exports from @calcom/trpc root (index.ts)
- Update 89 files to import from @calcom/trpc/react instead of @calcom/trpc
- This fixes the boundary leak where server builds were pulling in react code
- Server build no longer compiles react/app-router.ts, fixing the chicken-and-egg
issue where react code needed generated server types that didn't exist yet
This improves TypeScript build performance by preventing the server type
generation from traversing the entire react/client type graph.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: import WorkflowType from lib/types instead of React component
This fixes a boundary leak where the server build was pulling in React
components through the WorkflowRepository import chain. By importing
WorkflowListType from lib/types instead of WorkflowListPage.tsx, the
server build no longer traverses React component files.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: extract server-safe types to prevent boundary leaks in tRPC build
- Extract ChildrenEventType to lib/childrenEventType.ts (server-safe)
- Extract Slots type to calendars/lib/slots.ts (server-safe)
- Create types.server.ts files for eventtypes and bookings
- Update server code to import from server-safe type files
- Update DatePicker.tsx to use extracted Slots type
- Update app-store utils to use BookerEventForAppData type
This prevents the server build from pulling in React files through
transitive imports from @calcom/features barrel exports.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: update Segment.test.tsx mock path to @calcom/trpc/react
The test was mocking @calcom/trpc but importing from @calcom/trpc/react.
After the entrypoint separation, the mock path needs to match the import path.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: temporarily restore || true to unblock PR merge
The pre-existing Prisma type errors (~345 errors) will be addressed in a follow-up PR.
This allows the two-phase build architecture changes to be merged first.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Run trpc build as part of API v2 build
* Removed the bridge file
* refactor: extract event type schemas to server-safe file
- Create packages/features/eventtypes/lib/schemas.ts with createEventTypeInput and EventTypeDuplicateInput
- Update types.ts to re-export schemas from the new server-safe location
- Update tRPC schema files to import from schemas.ts instead of types.server.ts
- Delete types.server.ts (was duplicating ~200 lines unnecessarily)
This keeps the server build graph clean while avoiding code duplication.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Removed the optionality of the tRPC builds
* Removed the extra command for API v2
* refactor: rename calendars/lib/slots.ts to types.ts
Per Keith's feedback, renamed the file to types.ts since it contains type definitions.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Added back tRPC build:server for API v2
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com>
2025-12-20 23:43:04 -03:00
Keith WilliamsGitHubkeith@cal.com <keithwillcode@gmail.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* chore: dedupe yarn.lock to remove duplicate package versions
- Consolidated 762 duplicate package versions
- Reduced yarn.lock from 51,211 lines (1.7MB) to 44,471 lines (1.5MB)
- Removed 7,071 lines (~200KB) of redundant dependency entries
- Major packages deduplicated include: resolve, semver, type-fest, commander, glob, lru-cache, dotenv, @babel/* packages, typescript, tslib, postcss, and many more
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: resolve type errors in managed event types and react-select components
- Add Zod-compatible versions of allManagedEventTypeProps and unlockedManagedEventTypeProps
that only include scalar fields (excludes Prisma relation fields)
- Update handleChildrenEventTypes.ts and queries.ts to use the new Zod-compatible props
- Fix react-select CSS type errors in Select.tsx files by using Object.assign
instead of spread operator to avoid TypeScript type inference issues
- Fix lint warning in updateNewTeamMemberEventTypes by using if statement
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: derive eventType parameter type from actual query result
Use Awaited<ReturnType<typeof getEventTypesToAddNewMembers>>[number] to ensure
type safety at call sites, avoiding Prisma type namespace mismatches.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: disable turbo cache for @calcom/trpc#build to prevent stale type errors
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: correct field names in API v1 validation schemas
- Remove timeZone from booking schema (field doesn't exist on Booking model)
- Remove bookingId from destination-calendar schema (field doesn't exist, only booking relation)
- Change avatar to avatarUrl in user schema (correct field name)
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: use Object.assign for react-select styles to fix TypeScript spread type errors
The spread operator causes TypeScript to compute an incompatible type with
CSSObjectWithLabel due to the accentColor property. Using Object.assign
preserves the correct type inference.
Fixed files:
- FormEdit.tsx
- DestinationCalendarSelector.tsx (features and platform)
- TimezoneSelect.tsx
- ApiKeyDialogForm.tsx
- Select.tsx (features/form)
- WebhookForm.tsx
Also fixed pre-existing lint warnings:
- Constant truthiness in label assignment
- Unused variant parameter
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: remove extra fields from allManagedEventTypePropsForZod to match original behavior
The Zod-compatible version should only include scalar fields that were in the
original allManagedEventTypeProps. Removed instantMeetingScheduleId, profileId,
rrSegmentQueryValue, and assignRRMembersUsingSegment which were incorrectly
added and caused test failures by including extra fields in Prisma update payloads.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: remove access to fields not in Zod schema
- Remove unnecessary destructuring of profileId and instantMeetingScheduleId
from managedEventTypeValues in handleChildrenEventTypes.ts (these fields
are already sourced from other variables)
- Set rrSegmentQueryValue to undefined directly in queries.ts instead of
accessing it from managedEventTypeValues (not applicable for managed children)
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add name property to mock credentials and revert turbo cache change
- Add name property to MockCredential type and factory function in
InstallAppButtonChild.test.tsx to match expected credentials type
- Revert turbo cache disable for @calcom/trpc#build (per review comment)
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: revert API v1 validation changes and restore eslint comment
- Revert API v1 validation changes (booking.ts, destination-calendar.ts,
user.ts) since API v1 is deprecated and these could be breaking changes
- Restore eslint-disable comment for @typescript-eslint/no-empty-function
in Select.tsx that was accidentally removed
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add inputs to @calcom/trpc#build to properly invalidate cache
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: properly fix API v1 validation schemas for stricter zod 3.25.76
The yarn dedupe upgraded zod from 3.22.4 to 3.25.76, which has stricter
.pick() typing that now properly rejects picking non-existent fields.
Changes:
- user.ts: Pick avatarUrl (actual Prisma field) and extend with avatar
for API v1 backward compatibility
- booking.ts: Remove timeZone from pick (not a field on Booking model,
only exists in nested attendees/user objects)
- destination-calendar.ts: Remove bookingId from pick (not a field on
DestinationCalendar model)
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: remove turbo.json inputs for @calcom/trpc#build to use cached artifacts
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: use robust selector for react-select option in routing forms E2E test
The previous selector used .nth(1) which assumed the email text appeared
exactly twice in the DOM in a specific order. This broke when react-select
was upgraded from 5.7.2 to 5.8.0 via yarn dedupe.
The new approach waits for the react-select listbox to appear and clicks
the option within it, which is more robust against DOM structure changes.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Move InvalidAppCredentialBannerProps to packages/features/users/types/invalidAppCredentials.ts
- Add WorkflowListType to packages/features/ee/workflows/lib/types.ts
- Update server file imports to use new type locations
- Update React component imports to re-export from new locations
This fixes circular dependencies where server files were importing from React
component modules that import from @calcom/trpc, creating:
server -> component -> @calcom/trpc -> react -> server (circular)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix(auth): validate IdP authority before SAML account linking
Adds verification that SAML IdP is authoritative for the email domain
before allowing account conversion
* fix(auth): deny by default on missing SAML tenant + optimize membership query
- Block account conversion when tenant is missing (deny by default)
- Replace JOIN + ILIKE with two indexed lookups for O(1) performance
* refactor(auth): apply data minimization to security logs
* test
* update
* Refactor create-event-type.input.ts for slug handling
Removed unused import and transformation for slug.
* Remove slugify transformation from slug field
Removed slugify transformation from slug property.
* Remove slugify transformation from slug field
Removed slugify transformation from slug property.
2025-12-20 17:11:35 +00:00
Volnei MunhozGitHubkeith@cal.com <keithwillcode@gmail.com>keith@cal.com <keithwillcode@gmail.com>keith@cal.com <keithwillcode@gmail.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>keith@cal.com <keithwillcode@gmail.com>
* perf(googlecalendar): batch freebusy calls by delegation credential
- Group selectedCalendars by delegationCredentialId before making API calls
- Make one batched freebusy query per delegation credential group
- Reduces total API calls while respecting credential boundaries
- Maintains existing caching behavior per group
- Updated both getAvailability and getAvailabilityWithTimeZones methods
- Added groupCalendarsByDelegationCredential helper method
- Handles edge case when no calendars provided but fallbackToPrimary is true
- Fixed linting issue: replaced hasOwnProperty with 'in' operator
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* test(googlecalendar): add test for delegation credential batching
- Verify calendars are grouped by delegationCredentialId
- Ensure exactly 3 API calls made for 3 delegation credential groups
- Confirm all busy times from different groups are properly returned
- Fix type-safety issues by replacing 'as any' with proper type constraints
- Fix ESLint warnings: unused variables and any types in mock functions
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix(googlecalendar): ensure fallback logic works with empty calendar groups
- Handle empty calendar groups by ensuring at least one iteration
- Add test for chunking groups larger than 50 calendars
- Verify all delegation credential batching logic works correctly
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: fix remaining type errors from merge conflict resolution
- Changed getCacheOrFetchAvailability to getFreeBusyData in getAvailabilityWithTimeZones
- Removed orphaned merge conflict marker in test file
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: reset test file to original PR version and update method name
- Reset CalendarService.test.ts to original PR version (0e9eb9e97a)
- Updated getCacheOrFetchAvailability to getFreeBusyData to match main branch
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: reset test file to main branch version
The original PR's test file had tests for caching features that have been
removed from main. Reset to main's version to fix type errors.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* test(googlecalendar): add tests for delegation credential batching logic
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* Revamp devin's implementation
* Remove comsoles.log
* fix(tests): update delegation credential batching tests to match reimplementation
- Remove tests for private methods that no longer exist (groupCalendarsByDelegationCredential, chunkArray)
- Update getAvailability test to verify calendar fetching without expecting multiple API calls per delegation credential
- Keep existing tests for fallback to primary calendar and non-google calendar handling
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* Remove dead code
* improve documentation
* docs: add README explaining Google Calendar availability batching feature
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* docs: translate README to English
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* docs: move README to calendar-batch package with comprehensive documentation
- Remove README from googlecalendar lib (wrong location)
- Add comprehensive README to packages/features/calendar-batch/
- Document CalendarBatchService and CalendarBatchWrapper
- Explain how getCalendar() integrates with batching
- Include architecture, data model, and performance considerations
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: address cubic-dev-ai review comments
- Remove misleading comment from getCalendar.ts cache block
- Fix typo 'optmization' -> 'optimization' in comment
- Add comprehensive tests for CalendarBatchWrapper batching behavior
- Test separate calls for calendars without delegationCredentialId
- Test batching calendars with same delegationCredentialId
- Test chunking into groups of 50 for API limits
- Test mixed calendars handling
- Test fallbackToPrimary with empty array
- Test result flattening from batched calls
- Test pass-through methods delegation
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: add shouldServeCache param to CalendarBatchWrapper and verify batching call count
- Fix CalendarBatchWrapper.getAvailability signature to match Calendar interface (add shouldServeCache param)
- Update CalendarBatchWrapper tests to pass shouldServeCache parameter
- Add integration test in CalendarService.test.ts that verifies CalendarBatchWrapper makes separate API calls for different delegationCredentialIds (call count assertion)
- This fixes the getCalendarsEvents test failures caused by signature mismatch
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* Improve CalendarBatchImplementation
* test: add shouldServeCache forwarding and order-independent batching verification tests
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* test: make CalendarBatchWrapper tests order-independent
Refactored tests to avoid relying on Promise.all execution order:
- 'should make separate calls for calendars without delegationCredentialId'
now uses set comparison instead of toHaveBeenNthCalledWith
- 'should batch calendars with the same delegationCredentialId together'
now finds calls by delegation credential instead of call order
This addresses Sean's review comment about potential flakiness due to
Promise.all not guaranteeing execution order of parallel promises.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* Remove hardcoded ID
* test: add comprehensive tests for resolveCalendarServeStrategy
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* feat: use Promise.allSettled for partial failure handling in CalendarBatchWrapper
- Changed Promise.all to Promise.allSettled in getAvailability and getAvailabilityWithTimeZones
- Returns partial results when some batches fail instead of failing entirely
- Logs warnings for failed batches with error details
- Added tests for partial failure scenarios
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* test: add comprehensive tests for getAvailabilityWithTimeZones
- Added batching behavior tests (separate calls, batching by delegationCredentialId, chunking)
- Added partial failure handling tests (partial results, all fail, no throw)
- Added edge case test for underlying calendar not implementing the method
- Total: 24 tests now covering both getAvailability and getAvailabilityWithTimeZones
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add required serviceAccountKey fields to delegatedTo mock objects
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add missing client_id and private_key to serviceAccountKey mock
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: keith@cal.com <keithwillcode@gmail.com>
2025-12-20 13:45:44 -03:00
Anik Dhabal BabuGitHubanik@cal.com <adhabal2002@gmail.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: split confirm-emails e2e test to authenticate as booking owner
The test was flaky because it authenticated as an admin user (authEmail)
but created bookings for different users (emailsEnabledSetup.user and
emailsDisabledSetup.user). When confirming/declining bookings, the
ApiAuthGuard + BookingUidGuard rejected requests with 401 because the
authenticated user wasn't the booking owner.
The fix splits the test into two separate describe blocks, each with its
own app instance that authenticates as the actual booking owner. This
ensures the authenticated user always matches the booking owner.
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix: add unauthenticated app for attendee reschedule test
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix: use real API key authentication instead of withApiAuth mock
- Replace withApiAuth mock with real API key authentication using ApiKeysRepositoryFixture
- This avoids Passport strategy registration conflicts between test suites
- For attendee reschedule test, use unauthenticated request (no auth header) since endpoint uses OptionalApiAuthGuard
- Remove separate unauthenticatedApp instance as it's no longer needed
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
* fix flakes
* update
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Alex van AndelGitHubcubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Use previous header for android
* use activity instead of ternary statements
* update layout to use header buttons in availability screen
* fix styles and add context menu
* add set as default action
---------
Co-authored-by: Dhairyashil <dhairyashil10101010@gmail.com>
Booking confirmation pages contain PII (names, emails, phone numbers)
and should not be indexed by search engines
- Add robots noindex to /booking/[uid]/page.tsx
- Add robots noindex to /booking/[uid]/embed/page.tsx
Follows same pattern as not-found.tsx
- Add list-event-types.mdx with Quick start, Props, Demo video, and Combining with EventTypeSettings sections
- Add list_event_types_light.png screenshot
- Update mint.json navigation to include new page
* feat: add environment-based favicons (prod vs dev)
- Add cal-prod.png (dark/gray) favicon for production environments
- Add cal-dev.png (red) favicon for development/localhost environments
- Update FAVICON_16 and FAVICON_32 constants to switch based on IS_PRODUCTION
Co-Authored-By: peer@cal.com <peer@cal.com>
* feat: add higher resolution icons for all icon types (apple-touch, android-chrome, mstile)
- Add 180x180 apple-touch-icon for prod and dev
- Add 150x150 mstile icons for prod and dev
- Add 192x192 and 256x256 android-chrome icons for prod and dev
- Update all icon constants to use IS_PRODUCTION switching
Co-Authored-By: peer@cal.com <peer@cal.com>
* refactor: simplify favicon to single new design
- Remove environment-based favicon switching
- Update all icon files with new Cal favicon design
- Remove dev/prod icon variants
- Update constants to use static icon paths
Co-Authored-By: peer@cal.com <peer@cal.com>
* feat: add favicon.ico with new Cal favicon design
Co-Authored-By: peer@cal.com <peer@cal.com>
* chore: update favicon icons with final design
Co-Authored-By: peer@cal.com <peer@cal.com>
* chore: update favicon icons with final design v3
Co-Authored-By: peer@cal.com <peer@cal.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: add name property to delegation credentials for type compatibility
The MultiDisconnectIntegration component expects credentials with user.name property,
but delegation credentials only had user.email. This caused a type mismatch when
spreading both credential types together in appCredentialsByType handler.
Added name: null to the delegation credentials user object to ensure type compatibility.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: update getUserDisplayName to check value instead of just property existence
The narrowing logic was causing TypeScript to infer 'never' type because
after adding name property to delegation credentials, the 'name in user'
check always passes. Now we check if name has a truthy value before using it.
Also fixed lint warning by using optional chaining for onSuccess callback.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* fix: add explicit return type and typeof checks to getUserDisplayName
The function now has an explicit return type of string | null and uses
typeof checks to ensure proper type narrowing. This prevents TypeScript
from inferring a wider return type that includes {} when the user object
has properties with non-string types.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* test: update delegation credential test to include name property
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix: flaky E2E tests and refactor
* fix
* fix: week limit tests to use same week for pre-booking and UI booking
The week limit tests were failing because the pre-booking was created in
week 1 but the UI booking was done in week 2. Since weekly limits are
per-week, the pre-booking didn't count toward the limit in week 2.
Fixed by keeping both bookings in the same week:
- Pre-booking on Monday (satisfies daily limit, counts toward weekly)
- UI booking on Tuesday (same week, hits weekly limit of 2)
This ensures the weekly limit is properly tested and all remaining
weekdays in the week get blocked after hitting the limit.
Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* fix(companion): separate dev and prod build scripts to prevent localhost in production
- Add ext:build-dev and ext:build-prod scripts with clear separation
- Add BUILD_FOR_STORE flag to force production URL in store builds
- Add visual build indicators (store / dev) for clarity
- Prevent EXPO_PUBLIC_COMPANION_DEV_URL from leaking into production builds
* update commands to work for ci
* update version
---------
Co-authored-by: Volnei Munhoz <volnei@cal.com>
- Add CalComPageStatus handling in NotFound and ErrorPage components using useLayoutEffect
- Remove redundant pageStatus logic from PageWrapperAppDir.tsx since App Router error/notFound pages set status themselves
- Refactor embed-iframe.ts: split checkPageStatusAndHandleError into hasPageError() and handlePageError()
- Add page status checks before firing linkReady to catch errors set after initialization
- Ensures linkFailed event fires correctly for all error status codes in embed scenarios
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>