Skip to content

Comments

refactor: Break videoClient into two separate files in app-store and features#23992

Merged
keithwillcode merged 4 commits intomainfrom
refactor/video-client
Oct 10, 2025
Merged

refactor: Break videoClient into two separate files in app-store and features#23992
keithwillcode merged 4 commits intomainfrom
refactor/video-client

Conversation

@hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented Sep 23, 2025

What does this PR do?

  • Break @calcom/app-store/videoClient.ts into two files: (1) @calcom/app-store/getVideoAdapters.ts and (2) @calcom/features/conferencing/lib/videoClient.ts

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - 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.

How should this be tested?

  • Please use the latest Vercel preview and test please 🙏.

@hbjORbj hbjORbj requested a review from a team September 23, 2025 00:57
@hbjORbj hbjORbj requested a review from a team as a code owner September 23, 2025 00:57
@hbjORbj hbjORbj marked this pull request as draft September 23, 2025 00:57
@keithwillcode keithwillcode added core area: core, team members only foundation labels Sep 23, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Walkthrough

This PR migrates imports of conferencing utilities from "@calcom/app-store/videoClient" to "@calcom/features/conferencing/lib/videoClient" across API routes, TRPC handlers, feature modules, platform re-exports, and tests (including mocks). It adds packages/app-store/getVideoAdapters.ts exporting getVideoAdapters, refactors packages/features/conferencing/lib/videoClient.ts to consume that external function (removing its internal adapter factory), updates type imports in videoClient, and updates the README checkbox to mark the migration complete. One new exported function is introduced; public signatures otherwise remain unchanged.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title accurately and concisely describes the primary refactor, which is splitting the existing videoClient into two separate files in the app-store and features modules. It directly reflects the main change without extraneous detail or noise.
Description Check ✅ Passed The description clearly outlines the key change of breaking out videoClient into two files and includes relevant context and testing instructions that align with the changeset. It is directly related to the modifications and does not diverge into unrelated topics.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/video-client

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4ff1bb7 and 8754c80.

📒 Files selected for processing (6)
  • packages/features/bookings/lib/EventManager.ts (1 hunks)
  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts (1 hunks)
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts (1 hunks)
  • packages/features/instant-meeting/handleInstantMeeting.test.ts (1 hunks)
  • packages/features/instant-meeting/handleInstantMeeting.ts (1 hunks)
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/features/instant-meeting/handleInstantMeeting.test.ts
  • packages/features/bookings/lib/EventManager.ts
  • packages/features/instant-meeting/handleInstantMeeting.ts
  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

**/*.ts: For Prisma queries, only select data you need; never use include, always use select
Ensure the credential.key field is never returned from tRPC endpoints or APIs

Files:

  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
🔇 Additional comments (2)
packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts (1)

5-5: LGTM! Import path updated correctly.

The import source change from @calcom/app-store/videoClient to @calcom/features/conferencing/lib/videoClient aligns with the PR's refactoring objective. The function usage remains unchanged, and automated tests confirm the change works as expected.

packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts (1)

9-9: LGTM! Clean import path refactor.

The import path update aligns with the broader refactoring effort to separate videoClient concerns. The deleteMeeting function usage remains unchanged, and no functional modifications are introduced.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link

vercel bot commented Sep 23, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Oct 10, 2025 0:43am
cal-eu Ignored Ignored Oct 10, 2025 0:43am

@hbjORbj hbjORbj force-pushed the refactor/video-client branch from 9f945bf to 1bfac86 Compare October 9, 2025 13:48
@pull-request-size pull-request-size bot added size/L and removed size/XL labels Oct 9, 2025
@hbjORbj hbjORbj changed the title refactor: video client refactor: Break videoClient into two separate files in app-store and features Oct 9, 2025
@hbjORbj hbjORbj marked this pull request as ready for review October 9, 2025 13:50
@hbjORbj hbjORbj requested a review from a team as a code owner October 9, 2025 13:50
@graphite-app graphite-app bot requested a review from a team October 9, 2025 13:50
@hbjORbj hbjORbj enabled auto-merge (squash) October 9, 2025 13:56
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/app-store/getVideoAdapters.ts (1)

11-45: Consider filtering out undefined adapters.

The function correctly centralizes adapter construction with good error handling and fallback logic. However, since VideoApiAdapter can be undefined according to the type definition, and makeVideoApiAdapter(cred) could potentially return undefined, consider filtering out undefined values before returning:

 export const getVideoAdapters = async (withCredentials: CredentialPayload[]): Promise<VideoApiAdapter[]> => {
   const videoAdapters: VideoApiAdapter[] = [];

   for (const cred of withCredentials) {
     const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`;
     log.silly("Getting video adapter for", safeStringify({ appName, cred: getPiiFreeCredential(cred) }));

     let videoAdapterImport = VideoApiAdapterMap[appName as keyof typeof VideoApiAdapterMap];

     // fallback: transforms zoom_video to zoom
     if (!videoAdapterImport) {
       const appTypeVariant = cred.type.substring(0, cred.type.lastIndexOf("_"));
       log.silly(`Adapter not found for ${appName}, trying fallback ${appTypeVariant}`);

       videoAdapterImport = VideoApiAdapterMap[appTypeVariant as keyof typeof VideoApiAdapterMap];
     }

     if (!videoAdapterImport) {
       log.error(`Couldn't get adapter for ${appName}`);
       continue;
     }

     const videoAdapterModule = await videoAdapterImport;
     const makeVideoApiAdapter = videoAdapterModule.default as VideoApiAdapterFactory;

     if (makeVideoApiAdapter) {
       const videoAdapter = makeVideoApiAdapter(cred);
-      videoAdapters.push(videoAdapter);
+      if (videoAdapter) {
+        videoAdapters.push(videoAdapter);
+      }
     } else {
       log.error(`App ${appName} doesn't have a default VideoApiAdapter export`);
     }
   }

   return videoAdapters;
 };

This would make the return type cleaner and avoid potential issues with undefined values in the array. The current implementation works because callers use optional chaining, but filtering here would be more defensive.

packages/app-store/wipemycalother/lib/reschedule.ts (1)

184-184: Consider using named export for better tree-shaking and refactoring.

The default export could be replaced with a named export for consistency with the coding guidelines, which recommend named exports for better tree-shaking and easier refactoring.

Apply this diff to use a named export:

-export default Reschedule;
+export { Reschedule };

Alternatively, export it as a named export alongside the default if backward compatibility is required:

-export default Reschedule;
+export { Reschedule };
+export default Reschedule;

As per coding guidelines.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 445b307 and 4ff1bb7.

📒 Files selected for processing (24)
  • apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts (1 hunks)
  • apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts (1 hunks)
  • apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts (1 hunks)
  • apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts (2 hunks)
  • apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts (2 hunks)
  • apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts (2 hunks)
  • apps/web/app/api/recorded-daily-video/route.ts (1 hunks)
  • apps/web/app/api/video/recording/__tests__/route.test.ts (1 hunks)
  • apps/web/app/api/video/recording/route.ts (1 hunks)
  • packages/app-store/getVideoAdapters.ts (1 hunks)
  • packages/app-store/vital/lib/reschedule.ts (1 hunks)
  • packages/app-store/wipemycalother/lib/reschedule.ts (1 hunks)
  • packages/features/bookings/lib/EventManager.ts (1 hunks)
  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts (1 hunks)
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts (1 hunks)
  • packages/features/conferencing/README.md (1 hunks)
  • packages/features/conferencing/lib/videoClient.ts (2 hunks)
  • packages/features/instant-meeting/handleInstantMeeting.test.ts (1 hunks)
  • packages/features/instant-meeting/handleInstantMeeting.ts (1 hunks)
  • packages/platform/libraries/conferencing.ts (1 hunks)
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts (1 hunks)
  • tests/libs/__mocks__/videoClient.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

**/*.ts: For Prisma queries, only select data you need; never use include, always use select
Ensure the credential.key field is never returned from tRPC endpoints or APIs

Files:

  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
  • apps/web/app/api/video/recording/route.ts
  • apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
  • packages/features/instant-meeting/handleInstantMeeting.ts
  • packages/app-store/vital/lib/reschedule.ts
  • apps/web/app/api/recorded-daily-video/route.ts
  • packages/features/instant-meeting/handleInstantMeeting.test.ts
  • packages/features/bookings/lib/EventManager.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
  • packages/app-store/getVideoAdapters.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
  • tests/libs/__mocks__/videoClient.ts
  • apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
  • apps/web/app/api/video/recording/__tests__/route.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
  • packages/app-store/wipemycalother/lib/reschedule.ts
  • packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
  • packages/features/conferencing/lib/videoClient.ts
  • packages/platform/libraries/conferencing.ts
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
  • apps/web/app/api/video/recording/route.ts
  • apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
  • packages/features/instant-meeting/handleInstantMeeting.ts
  • packages/app-store/vital/lib/reschedule.ts
  • apps/web/app/api/recorded-daily-video/route.ts
  • packages/features/instant-meeting/handleInstantMeeting.test.ts
  • packages/features/bookings/lib/EventManager.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
  • packages/app-store/getVideoAdapters.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
  • tests/libs/__mocks__/videoClient.ts
  • apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
  • apps/web/app/api/video/recording/__tests__/route.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
  • packages/app-store/wipemycalother/lib/reschedule.ts
  • packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
  • packages/features/conferencing/lib/videoClient.ts
  • packages/platform/libraries/conferencing.ts
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
  • apps/web/app/api/video/recording/route.ts
  • apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
  • packages/features/instant-meeting/handleInstantMeeting.ts
  • packages/app-store/vital/lib/reschedule.ts
  • apps/web/app/api/recorded-daily-video/route.ts
  • packages/features/instant-meeting/handleInstantMeeting.test.ts
  • packages/features/bookings/lib/EventManager.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
  • packages/app-store/getVideoAdapters.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
  • tests/libs/__mocks__/videoClient.ts
  • apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
  • apps/web/app/api/video/recording/__tests__/route.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
  • packages/app-store/wipemycalother/lib/reschedule.ts
  • packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
  • packages/features/conferencing/lib/videoClient.ts
  • packages/platform/libraries/conferencing.ts
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
🧬 Code graph analysis (1)
packages/app-store/getVideoAdapters.ts (3)
packages/types/VideoApiAdapter.d.ts (2)
  • VideoApiAdapter (19-49)
  • VideoApiAdapterFactory (51-51)
packages/lib/piiFreeData.ts (1)
  • getPiiFreeCredential (60-71)
packages/app-store/video.adapters.generated.ts (1)
  • VideoApiAdapterMap (5-20)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Detect changes
🔇 Additional comments (27)
packages/features/instant-meeting/handleInstantMeeting.ts (1)

25-25: LGTM! Import path updated correctly.

The import path for createInstantMeetingWithCalVideo has been successfully migrated to the new location. The function usage remains unchanged throughout the file.

apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts (1)

3-3: LGTM! Import path updated correctly.

The import path for getAllTranscriptsAccessLinkFromRoomName has been successfully migrated to the new location. The function usage remains unchanged.

packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts (1)

13-13: LGTM! Import path updated correctly.

The import path for updateMeeting has been successfully migrated to the new location. The function usage at line 103 remains unchanged.

packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts (1)

5-5: LGTM! Import path updated correctly.

The import path for deleteMeeting has been successfully migrated to the new location. The function usage at line 43 remains unchanged.

packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts (1)

25-25: LGTM! Import path updated correctly.

The import path for deleteMeeting has been successfully migrated to the new location. The function usage at line 259 remains unchanged.

apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts (1)

3-6: LGTM! Import path updated correctly.

The import path for getRecordingsOfCalVideoByRoomName and getDownloadLinkOfCalVideoByRecordingId has been successfully migrated to the new location. The function usage remains unchanged.

apps/web/app/api/video/recording/route.ts (1)

3-3: LGTM! Import path updated correctly.

The import path for getDownloadLinkOfCalVideoByRecordingId has been successfully migrated to the new location. The function usage remains unchanged.

packages/app-store/vital/lib/reschedule.ts (1)

9-9: LGTM! Import path updated correctly.

The import path for deleteMeeting has been successfully migrated to the new location. The function usage at line 152 remains unchanged.

apps/web/app/api/recorded-daily-video/route.ts (1)

17-20: LGTM! Import path correctly updated.

The import path has been properly updated to the new module location. Function usage throughout the file remains unchanged, which is correct for this refactoring.

packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts (1)

3-3: LGTM! Import path correctly updated.

The import path has been properly updated to reflect the new module structure. The function usage and error handling remain unchanged.

packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts (1)

1-1: LGTM! Import path correctly updated.

The import path has been properly migrated to the new module location. Function usage remains unchanged.

apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts (1)

9-9: LGTM! Import and mock paths correctly updated.

Both the import path and the corresponding mock have been properly updated to reference the new module location. The mock implementation remains unchanged, ensuring test behavior is preserved.

Also applies to: 19-23

apps/web/app/api/video/recording/__tests__/route.test.ts (1)

4-4: LGTM! Import and mock paths correctly updated.

The import and mock paths have been properly updated to the new module location. The mock implementation and test logic remain unchanged, preserving test functionality.

Also applies to: 9-11

packages/features/instant-meeting/handleInstantMeeting.test.ts (1)

23-30: LGTM! Mock path correctly updated.

The mock path has been properly updated to reference the new module location. The mock implementation remains unchanged, which correctly preserves the test behavior.

apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts (1)

9-12: LGTM! Import and mock paths correctly updated.

Both the import paths and the corresponding mocks have been properly updated to reference the new module location. The mock implementations remain unchanged, ensuring test consistency.

Also applies to: 25-30

apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts (1)

8-11: LGTM! Import and mock paths correctly updated.

The import paths and corresponding mocks have been properly updated to the new module location. Mock implementations remain unchanged, preserving test behavior.

Also applies to: 22-27

apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts (2)

3-6: LGTM! Import path updated correctly.

The import path has been successfully updated to the new location as part of the refactor to separate video client functionality.


62-66: Verify Prisma query follows coding guidelines.

The Prisma query uses include: { references: true } instead of select, which violates the coding guideline that states "only select data you need; never use include, always use select". While this code predates the current PR, please verify if this should be refactored to use select with only the needed fields from references.

As per coding guidelines.

tests/libs/__mocks__/videoClient.ts (1)

4-6: LGTM! Test mock updated correctly.

The mock has been properly updated to reference the new module path, maintaining the same mock behavior.

packages/platform/libraries/conferencing.ts (1)

1-5: LGTM! Re-export path updated correctly.

The re-export statement has been properly updated to the new module path, maintaining the same public API surface.

packages/features/bookings/lib/EventManager.ts (1)

40-40: LGTM! Import path updated correctly.

The import has been successfully updated to reference the new video client location, maintaining the same function signatures and behavior.

packages/features/conferencing/lib/videoClient.ts (3)

6-6: LGTM! Adapter factory externalized correctly.

The refactor to use an external getVideoAdapters function successfully centralizes the adapter construction logic, improving code organization and maintainability.


19-19: LGTM! Logger prefix updated correctly.

The logger prefix has been updated to reflect the new module path, maintaining consistency in log output.


23-26: Good use of optional chaining for adapter calls.

The code correctly uses optional chaining (?.) when calling adapter methods, which safely handles cases where getVideoAdapters might return adapters with undefined values.

packages/app-store/getVideoAdapters.ts (2)

14-26: LGTM! Fallback logic handles type variations well.

The transformation logic and fallback mechanism correctly handles credential type variations (e.g., zoom_videozoomvideozoom), making the adapter lookup more resilient.


28-31: LGTM! Appropriate error handling with continue.

Continuing on missing adapters allows the function to process remaining credentials, which is the correct behavior for this use case where you want to collect all available adapters.

packages/app-store/wipemycalother/lib/reschedule.ts (1)

9-9: Approve import path migration. All occurrences of @calcom/app-store/videoClient have been replaced with @calcom/features/conferencing/lib/videoClient across the codebase.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 445b307 and 4ff1bb7.

📒 Files selected for processing (24)
  • apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts (1 hunks)
  • apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts (1 hunks)
  • apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts (1 hunks)
  • apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts (2 hunks)
  • apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts (2 hunks)
  • apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts (2 hunks)
  • apps/web/app/api/recorded-daily-video/route.ts (1 hunks)
  • apps/web/app/api/video/recording/__tests__/route.test.ts (1 hunks)
  • apps/web/app/api/video/recording/route.ts (1 hunks)
  • packages/app-store/getVideoAdapters.ts (1 hunks)
  • packages/app-store/vital/lib/reschedule.ts (1 hunks)
  • packages/app-store/wipemycalother/lib/reschedule.ts (1 hunks)
  • packages/features/bookings/lib/EventManager.ts (1 hunks)
  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts (1 hunks)
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts (1 hunks)
  • packages/features/conferencing/README.md (1 hunks)
  • packages/features/conferencing/lib/videoClient.ts (2 hunks)
  • packages/features/instant-meeting/handleInstantMeeting.test.ts (1 hunks)
  • packages/features/instant-meeting/handleInstantMeeting.ts (1 hunks)
  • packages/platform/libraries/conferencing.ts (1 hunks)
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts (1 hunks)
  • packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts (1 hunks)
  • tests/libs/__mocks__/videoClient.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

**/*.ts: For Prisma queries, only select data you need; never use include, always use select
Ensure the credential.key field is never returned from tRPC endpoints or APIs

Files:

  • packages/app-store/getVideoAdapters.ts
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
  • apps/web/app/api/video/recording/route.ts
  • apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
  • packages/features/instant-meeting/handleInstantMeeting.test.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
  • tests/libs/__mocks__/videoClient.ts
  • packages/app-store/vital/lib/reschedule.ts
  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
  • packages/app-store/wipemycalother/lib/reschedule.ts
  • apps/web/app/api/video/recording/__tests__/route.test.ts
  • packages/features/instant-meeting/handleInstantMeeting.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
  • apps/web/app/api/recorded-daily-video/route.ts
  • apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
  • packages/platform/libraries/conferencing.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
  • packages/features/bookings/lib/EventManager.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
  • packages/features/conferencing/lib/videoClient.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • packages/app-store/getVideoAdapters.ts
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
  • apps/web/app/api/video/recording/route.ts
  • apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
  • packages/features/instant-meeting/handleInstantMeeting.test.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
  • tests/libs/__mocks__/videoClient.ts
  • packages/app-store/vital/lib/reschedule.ts
  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
  • packages/app-store/wipemycalother/lib/reschedule.ts
  • apps/web/app/api/video/recording/__tests__/route.test.ts
  • packages/features/instant-meeting/handleInstantMeeting.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
  • apps/web/app/api/recorded-daily-video/route.ts
  • apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
  • packages/platform/libraries/conferencing.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
  • packages/features/bookings/lib/EventManager.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
  • packages/features/conferencing/lib/videoClient.ts
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • packages/app-store/getVideoAdapters.ts
  • packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
  • apps/web/app/api/video/recording/route.ts
  • apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts
  • packages/features/instant-meeting/handleInstantMeeting.test.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts
  • tests/libs/__mocks__/videoClient.ts
  • packages/app-store/vital/lib/reschedule.ts
  • packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts
  • packages/app-store/wipemycalother/lib/reschedule.ts
  • apps/web/app/api/video/recording/__tests__/route.test.ts
  • packages/features/instant-meeting/handleInstantMeeting.ts
  • packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts
  • apps/web/app/api/recorded-daily-video/route.ts
  • apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts
  • packages/platform/libraries/conferencing.ts
  • apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts
  • packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts
  • packages/features/bookings/lib/EventManager.ts
  • apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts
  • packages/features/conferencing/lib/videoClient.ts
🧬 Code graph analysis (1)
packages/app-store/getVideoAdapters.ts (3)
packages/types/VideoApiAdapter.d.ts (2)
  • VideoApiAdapter (19-49)
  • VideoApiAdapterFactory (51-51)
packages/lib/piiFreeData.ts (1)
  • getPiiFreeCredential (60-71)
packages/app-store/video.adapters.generated.ts (1)
  • VideoApiAdapterMap (5-20)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Detect changes
🔇 Additional comments (19)
packages/features/conferencing/README.md (1)

3-3: Migration checkbox update looks good.

Marking this task complete matches the refactor work in this PR.

packages/app-store/vital/lib/reschedule.ts (1)

9-9: LGTM! Import path migration completed.

The import path for deleteMeeting has been correctly updated to the new module location.

packages/app-store/getVideoAdapters.ts (1)

11-45: LGTM! Adapter factory logic is well-structured.

The function correctly handles:

  • Credential iteration and adapter name derivation
  • Fallback logic for variant types (e.g., "zoom_video" → "zoom")
  • Graceful error handling when adapters are not found
  • PII-free logging for debugging
  • Proper async/await for dynamic imports

The edge case where lastIndexOf("_") returns -1 (no underscore) is handled gracefully—substring(0, -1) returns an empty string, which won't match in the map, and the error is logged appropriately.

packages/features/instant-meeting/handleInstantMeeting.ts (1)

25-25: LGTM! Import path migration completed.

The import path for createInstantMeetingWithCalVideo has been correctly updated to the new module location.

packages/features/bookings/lib/EventManager.ts (1)

40-40: LGTM! Import path migration completed.

The import path for video client functions has been correctly updated to the new module location.

apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts (2)

9-12: LGTM! Test imports updated correctly.

The import path for video client test functions has been correctly updated to the new module location.


25-30: LGTM! Mock configuration updated correctly.

The mock path has been correctly updated to match the new module location, ensuring test isolation is maintained.

packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts (1)

13-13: LGTM! Import path migration completed.

The import path for updateMeeting has been correctly updated to the new module location.

packages/app-store/wipemycalother/lib/reschedule.ts (1)

9-9: LGTM! Import path migration completed.

The import path for deleteMeeting has been correctly updated to the new module location.

apps/web/app/api/video/recording/route.ts (1)

3-3: LGTM! Import path migration completed.

The import path for getDownloadLinkOfCalVideoByRecordingId has been correctly updated to the new module location.

packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts (1)

3-3: LGTM: Import path updated correctly.

The import path change aligns with the module reorganization. Function usage remains unchanged.

apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts (1)

3-3: LGTM: Import path updated correctly.

packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts (1)

5-5: LGTM: Import path updated correctly.

packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts (1)

25-25: LGTM: Import path updated correctly.

apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts (1)

9-9: LGTM: Import and mock paths updated correctly.

Both the import statement and the mock configuration have been updated to use the new module path, maintaining consistency.

Also applies to: 19-23

packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts (1)

1-1: LGTM: Import path updated correctly.

packages/features/instant-meeting/handleInstantMeeting.test.ts (1)

23-30: LGTM: Mock path updated correctly.

apps/web/app/api/recorded-daily-video/route.ts (1)

18-20: LGTM: Import path updated correctly.

packages/platform/libraries/conferencing.ts (1)

1-5: LGTM—confirmed that @calcom/features/conferencing/lib/videoClient exports getRecordingsOfCalVideoByRoomName, getDownloadLinkOfCalVideoByRecordingId, and getAllTranscriptsAccessLinkFromRoomName.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

E2E results are ready!

keithwillcode
keithwillcode previously approved these changes Oct 9, 2025
@keithwillcode keithwillcode merged commit dbe55f0 into main Oct 10, 2025
40 checks passed
@keithwillcode keithwillcode deleted the refactor/video-client branch October 10, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants