Commit Graph
2 Commits
Author SHA1 Message Date
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
Benny JooandGitHub bb68cd73ef refactor: circular deps between app store and lib [6] (#23971)
* move delegation credential repository to features

* mv credential repository to features

* update imports

* mv

* fix

* fix

* fix

* fix

* fix

* update imports

* update imports

* update eslint rule

* fix

* fix

* mv getConnectedDestinationCalendars

* fix import errors

* mv getCalendarsEvents

* remove getUsersCredentials

* wip

* revert eslint rule change for now

* fix type checks

* fix

* format

* cleanup

* fix

* fix

* fix

* fix

* fix tests

* migrate getUserAvailability

* migrate

* fix tests

* fix type checks

* fix

* fix

* migrate crmManager

* update imports

* migrate raqbUtils to appstore

* migrate getLuckyUser to features

* migrate findTeamMembersMatchingAttributeLogic to appstore

* update imports

* fix

* fix

* fix test

* fix unit tests

* fix

* fix

* add eslint config
2025-10-09 14:02:12 +00:00