Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: premise recording sdk support #4021

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

hmahant-webex
Copy link
Contributor

@hmahant-webex hmahant-webex commented Dec 5, 2024

COMPLETES # SPARK-560871

This pull request addresses

Video Mesh has a requirement to support premise recordings. This is irrespective of any meeting type (Private or non-private). Detailed business justification can be found here: https://cisco-my.sharepoint.com/:w:/p/roshin/EXmmBsz8qHdJknee8fKiFnQBDCXOH9YBGL_S_MyhjCtLrw?e=P2Se1V

Documentation: https://confluence-eng-gpk2.cisco.com/conf/display/WTWC/SPARK-560871+-+VMN-Recording%3A+Web+Client+support

by making the following changes

Adding the support for recordingType in the rss recording api.
Checking the displayhints to make sure whether it is a premise recording or cloud recording

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new constants for premise recording controls.
    • Added support for premise recording capabilities in the meeting actions interface.
    • Enhanced recording functionalities with new recording types (Premise and Cloud).
    • Improved user permissions management related to recording in meetings.
    • Enhanced media connection handling during meetings.
  • Bug Fixes

    • Improved error handling for meeting joining scenarios.
  • Tests

    • Expanded test coverage for premise recording functionalities and updated existing tests for consistency.

@hmahant-webex hmahant-webex requested review from a team as code owners December 5, 2024 16:40
Copy link

coderabbitai bot commented Dec 5, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning eslint > @humanwhocodes/[email protected]: Use @eslint/config-array instead
warning eslint > @humanwhocodes/config-array > @humanwhocodes/[email protected]: Use @eslint/object-schema instead
warning eslint > file-entry-cache > flat-cache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning eslint-import-resolver-typescript > [email protected]: Glob versions prior to v9 are no longer supported
warning [email protected]: Glob versions prior to v9 are no longer supported
warning intern > [email protected]: Glob versions prior to v9 are no longer supported
warning intern > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning jasmine > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > jest-cli > jest-config > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/transform > babel-plugin-istanbul > test-exclude > [email protected]: Glob versions prior to v9 are no longer supported
warning mocha > [email protected]: Glob versions prior to v9 are no longer supported
warning mocha > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning [email protected]: 16.1.1
warning wd > [email protected]: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.

(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning wd > archiver > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > [email protected]: request has been deprecated, see request/request#3142
warning wd > archiver > archiver-utils > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > request > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning wd > request > [email protected]: this library is no longer supported
warning @babel/cli > [email protected]: Glob versions prior to v9 are no longer supported
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
warning @babel/polyfill > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @babel/runtime-corejs2 > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning babel-plugin-lodash > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > [email protected]: 16.1.1
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning workspace-aggregator-cb248af0-6181-4055-bb30-c33dd5129819 > @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
error [email protected]: The engine "node" is incompatible with this module. Expected version "^14 || ^16 || ^17 || ^18 || ^19". Got "22.9.0"
error Found incompatible module.

Walkthrough

The pull request introduces several modifications across multiple files in the @webex/plugin-meetings package. Key changes include the addition of new constants for premise recording controls, updates to the IInMeetingActions interface, and enhancements to the RecordingController class to accommodate different recording types. Additionally, new utility functions and test cases have been added to support the new functionality, ensuring that both premise and cloud recording capabilities are effectively integrated and tested.

Changes

File Change Summary
packages/@webex/plugin-meetings/src/constants.ts Added constants: PREMISE_RECORDING_CONTROL_START, PREMISE_RECORDING_CONTROL_PAUSE, PREMISE_RECORDING_CONTROL_STOP, PREMISE_RECORDING_CONTROL_RESUME.
packages/@webex/plugin-meetings/src/meeting/in-meeting-actions.ts Added optional property isPremiseRecordingEnabled to IInMeetingActions interface and InMeetingActions class. Updated get method to return this property.
packages/@webex/plugin-meetings/src/recording-controller/enums.ts Updated RecordingAction enum to be exported and added new RecordingType enum with members Premise and Cloud.
packages/@webex/plugin-meetings/src/recording-controller/index.ts Updated recordingService method to accept recordingType parameter and modified recordingFacade method to determine recording type based on premise recording status.
packages/@webex/plugin-meetings/src/recording-controller/util.ts Added isPremiseRecordingEnabled function and updated recording capability functions to check for premise recording controls. Changed import statement for RecordingAction.
packages/@webex/plugin-meetings/test/unit/spec/meeting/in-meeting-actions.ts Added isPremiseRecordingEnabled to expectedValues in tests for InMeetingActions.
packages/@webex/plugin-meetings/test/unit/spec/recording-controller/index.js Updated tests to include recordingType in request bodies for recording actions based on display hints.
packages/@webex/plugin-meetings/test/unit/spec/recording-controller/util.js Added tests for premise recording functionality and updated import statement for RecordingAction.
packages/@webex/webex-core/src/lib/webex-http-error.js Added TooManyRequests class as a subtype of HttpError.BadRequest and modified parse method to include response body and error code.

Possibly related PRs

Suggested labels

validated

Suggested reviewers

  • marcin-bazyl
  • szotrabh
  • edvujic

Poem

In the meadow where meetings convene,
New constants hop in, a sight to be seen.
With controls for recording, both cloud and premise,
Our actions now dance, in sync, they’re a premise!
So let’s cheer for the changes, a leap and a bound,
In the world of Webex, new features abound! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 7

🧹 Outside diff range and nitpick comments (7)
packages/@webex/plugin-meetings/src/recording-controller/index.ts (2)

231-234: Add missing JSDoc comment for the recordingType parameter

The recordingService method's JSDoc is missing documentation for the recordingType parameter. Please add a @param tag for it.

     * @param {RecordingAction} action
+    * @param {RecordingType} recordingType
      * @private
      * @memberof RecordingController
      * @returns {Promise}

289-294: Simplify recordingType assignment using a ternary operator

You can simplify the assignment of recordingType by using a ternary operator for conciseness.

-        let recordingType: RecordingType;
-        if (premiseRecStatus) {
-          recordingType = RecordingType.Premise;
-        } else {
-          recordingType = RecordingType.Cloud;
-        }
+        const recordingType = premiseRecStatus ? RecordingType.Premise : RecordingType.Cloud;
packages/@webex/webex-core/src/lib/webex-http-error.js (1)

30-30: Simplify conditional with optional chaining operator

You can simplify the conditional check by using the optional chaining operator ?..

         if (this.body && this.body.errorCode) {
-          message += `\nerrorCode : ${this.body.errorCode}`;
+          message += `\nerrorCode : ${this.body?.errorCode}`;
         }
🧰 Tools
🪛 Biome (1.9.4)

[error] 30-30: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/@webex/plugin-meetings/src/constants.ts (1)

907-910: LGTM! Consider adding JSDoc comments.

The new premise recording control constants are well-structured and follow the existing patterns. They're appropriately placed in alphabetical order within the DISPLAY_HINTS object.

Consider adding JSDoc comments to document the purpose and usage of these new constants, similar to how other sections like LAYOUT_TYPES are documented. For example:

/**
 * @description Display hints for premise recording controls
 * @constant
 */
packages/@webex/plugin-meetings/test/unit/spec/recording-controller/index.js (1)

231-240: Consider parameterizing premise recording tests.

The premise recording tests follow the same pattern for all actions (start, stop, pause, resume). Consider using test parameterization to reduce code duplication.

Example refactor:

const recordingActions = [
  { action: 'start', hint: 'PREMISE_RECORDING_CONTROL_START' },
  { action: 'stop', hint: 'PREMISE_RECORDING_CONTROL_STOP' },
  { action: 'pause', hint: 'PREMISE_RECORDING_CONTROL_PAUSE' },
  { action: 'resume', hint: 'PREMISE_RECORDING_CONTROL_RESUME' }
];

recordingActions.forEach(({action, hint}) => {
  it(`can ${action} premise recording when the correct display hint is present`, () => {
    controller.setDisplayHints([hint]);
    const result = controller[`${action}Recording`]();
    
    assert.calledWith(request.request, {
      uri: `test/loci/id/recording`,
      body: {
        meetingInfo: {locusSessionId: 'testId'},
        recording: {action},
        recordingType: 'premise'
      },
      method: HTTP_VERBS.PUT
    });
    
    assert.deepEqual(result, request.request.firstCall.returnValue);
  });
});

Also applies to: 269-277, 307-315, 345-353

packages/@webex/plugin-meetings/test/unit/spec/recording-controller/util.js (2)

32-39: Consider adding more comprehensive test coverage for premise recording.

While the basic test cases for premise recording controls are good, consider adding:

  1. Tests verifying behavior when both cloud and premise recording hints are present
  2. Tests for policy checks with premise recording (similar to existing cloud recording tests)
  3. Negative test cases specific to premise recording

Example test case to add:

it('prioritizes premise recording when both cloud and premise hints are present', () => {
  locusInfo.parsedLocus.info.userDisplayHints.push('RECORDING_CONTROL_START');
  locusInfo.parsedLocus.info.userDisplayHints.push('PREMISE_RECORDING_CONTROL_START');

  assert.equal(
    RecordingUtil.canUserStart(locusInfo.parsedLocus.info.userDisplayHints),
    true
  );
  // Add assertions to verify which type of recording is prioritized
});

Also applies to: 81-88, 130-137, 181-188


32-32: Add JSDoc comments explaining premise recording test scenarios.

To improve maintainability and align with the PR's objective of adding premise recording support, consider adding JSDoc comments explaining:

  • The purpose of premise recording tests
  • The difference between cloud and premise recording controls
  • Any specific requirements or constraints for premise recording

Example:

/**
 * Test suite for premise recording controls.
 * Premise recording differs from cloud recording in that... [explain difference]
 * These tests verify that the SDK correctly handles premise recording display hints
 * and maintains compatibility with existing cloud recording functionality.
 */
describe('premise recording tests', () => {
  // ... existing tests ...
});
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 425cdb6 and be1b537.

📒 Files selected for processing (9)
  • packages/@webex/plugin-meetings/src/constants.ts (1 hunks)
  • packages/@webex/plugin-meetings/src/meeting/in-meeting-actions.ts (3 hunks)
  • packages/@webex/plugin-meetings/src/recording-controller/enums.ts (1 hunks)
  • packages/@webex/plugin-meetings/src/recording-controller/index.ts (4 hunks)
  • packages/@webex/plugin-meetings/src/recording-controller/util.ts (2 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/in-meeting-actions.ts (2 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/recording-controller/index.js (4 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/recording-controller/util.js (6 hunks)
  • packages/@webex/webex-core/src/lib/webex-http-error.js (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/@webex/webex-core/src/lib/webex-http-error.js

[error] 30-30: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (3)
packages/@webex/plugin-meetings/src/recording-controller/enums.ts (1)

1-1: Verify impact of changing default export to named export for RecordingAction

By changing RecordingAction from a default export to a named export, you may affect modules that import it as a default export. Ensure that all imports of RecordingAction are updated to use named imports to prevent breaking changes.

Run the following script to find all imports of RecordingAction and check if they use default imports:

packages/@webex/plugin-meetings/test/unit/spec/recording-controller/index.js (1)

224-229: Verify HTTP method consistency.

The test now uses PUT instead of PATCH for recording actions. Ensure this change is intentional and documented in the API specifications.

✅ Verification successful

HTTP method change is intentional and consistent with implementation

The change from PATCH to PUT for recording actions is intentional and consistent across the codebase. The implementation in src/recording-controller/index.ts uses HTTP_VERBS.PUT for all recording actions (start, stop, pause, resume) for both cloud and premise recording types. The test changes align with this implementation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if there are any remaining PATCH endpoints for recording
rg -A 2 "method: HTTP_VERBS.PATCH.*recording"

Length of output: 47


Script:

#!/bin/bash
# Let's search for all recording-related HTTP methods to understand the pattern
rg -B 2 -A 2 "recording.*method: HTTP_VERBS\." --type js

# Also search for any recording-related API documentation
fd -e md -e txt . | xargs rg -l "recording.*api"

# Check the actual implementation of recording endpoints
ast-grep --pattern 'recording($$$) {
  $$$
  method: $_
  $$$
}'

Length of output: 329


Script:

#!/bin/bash
# Let's try a broader search for recording-related HTTP methods
rg -B 2 -A 2 "method.*HTTP_VERBS" packages/@webex/plugin-meetings

# Search specifically in the recording controller implementation
fd "recording-controller" --type f --exec cat {}

# Look for any recording-related tests
rg -B 2 -A 2 "recording.*test|test.*recording" packages/@webex/plugin-meetings/test

Length of output: 52668

packages/@webex/plugin-meetings/test/unit/spec/recording-controller/util.js (1)

2-2: Verify the impact of import change across the codebase.

The change from default to named import of RecordingAction suggests a refactor in the enums file. Let's verify that all imports are consistently updated.

✅ Verification successful

Import change is consistent with the codebase

The RecordingAction enum is properly exported in the enums file and the test file is the only one importing it. The named import usage is correct as the enum is exported using a named export. No issues were found with the import changes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining default imports of RecordingAction
rg "import RecordingAction from.*recording-controller/enums" --type js --type ts

Length of output: 82


Script:

#!/bin/bash
# Search for any imports of RecordingAction (both named and default)
rg "import.*RecordingAction.*from.*recording-controller/enums" --type js --type ts

# Also check the enum file itself to understand the export
fd "enums.ts|enums.js" -t f --exec cat {}

Length of output: 848

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4021.d3m3l2kee0btzx.amplifyapp.com

Copy link

@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

🧹 Outside diff range and nitpick comments (2)
packages/@webex/plugin-meetings/src/recording-controller/index.ts (2)

289-295: Simplify conditional assignment of recordingType

You can simplify the assignment of recordingType by using a ternary operator:

-        let recordingType: RecordingType;
-        if (premiseRecStatus) {
-          recordingType = RecordingType.Premise;
-        } else {
-          recordingType = RecordingType.Cloud;
-        }
+        const recordingType = premiseRecStatus ? RecordingType.Premise : RecordingType.Cloud;

231-231: Add description for recordingType parameter in the documentation

Please include a brief description for the recordingType parameter in the method's documentation to enhance clarity.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between be1b537 and ae2c864.

📒 Files selected for processing (6)
  • packages/@webex/plugin-meetings/src/meeting/in-meeting-actions.ts (3 hunks)
  • packages/@webex/plugin-meetings/src/meeting/index.ts (1 hunks)
  • packages/@webex/plugin-meetings/src/recording-controller/index.ts (4 hunks)
  • packages/@webex/plugin-meetings/src/recording-controller/util.ts (2 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/in-meeting-actions.ts (2 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/recording-controller/util.js (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/in-meeting-actions.ts
  • packages/@webex/plugin-meetings/src/meeting/in-meeting-actions.ts
  • packages/@webex/plugin-meetings/test/unit/spec/recording-controller/util.js
  • packages/@webex/plugin-meetings/src/recording-controller/util.ts
🔇 Additional comments (1)
packages/@webex/plugin-meetings/src/meeting/index.ts (1)

3769-3772: Code addition for 'isPremiseRecordingEnabled' looks good

The isPremiseRecordingEnabled property is correctly added and utilizes the RecordingUtil.isPremiseRecordingEnabled function with appropriate arguments.

Copy link

@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

🧹 Outside diff range and nitpick comments (3)
packages/@webex/plugin-meetings/src/recording-controller/index.ts (3)

236-236: Consider specifying a more precise return type

The Promise return type could be more specific to improve type safety and documentation.

-  private recordingService(action: RecordingAction, recordingType: RecordingType): Promise<any> {
+  private recordingService(action: RecordingAction, recordingType: RecordingType): Promise<{success: boolean}> {

281-284: Consider renaming the boolean variable for clarity

The variable isPremiseRecordingEnabled is named like a function but holds a boolean value.

-    const isPremiseRecordingEnabled = Util.isPremiseRecordingEnabled(
+    const premiseRecordingEnabled = Util.isPremiseRecordingEnabled(
       this.displayHints,
       this.selfUserPolicies
     );

289-295: Add logging for selected recording type

Consider logging which recording type was selected for better debugging and monitoring.

     let recordingType: RecordingType;
     if (isPremiseRecordingEnabled) {
       recordingType = RecordingType.Premise;
     } else {
       recordingType = RecordingType.Cloud;
     }
+    LoggerProxy.logger.log(
+      `RecordingController:index#recordingFacade --> selected recording type [${recordingType}]`
+    );
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ae2c864 and f9aaf75.

📒 Files selected for processing (1)
  • packages/@webex/plugin-meetings/src/recording-controller/index.ts (4 hunks)
🔇 Additional comments (2)
packages/@webex/plugin-meetings/src/recording-controller/index.ts (2)

5-5: LGTM: Import changes align with premise recording support

The addition of RecordingType import is appropriate for the new premise recording functionality.


Line range hint 231-246: LGTM: recordingService method properly integrates recordingType

The implementation correctly handles the new recordingType parameter in both the method signature and request body.

@@ -22,6 +22,15 @@ export default class WebexHttpError extends HttpError {
value: res.options,
});

Reflect.defineProperty(this, 'body', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this change made for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is added to get the error code if available from the failed API response so that we can log it for better troubleshooting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm kind of concerned about this change. Not sure why we have not needed this before. But I have not tested it and if it's needed, it does seem fine.

@chrisadubois chrisadubois added the validated If the pull request is validated for automation. label Dec 9, 2024
@@ -22,6 +22,15 @@ export default class WebexHttpError extends HttpError {
value: res.options,
});

Reflect.defineProperty(this, 'body', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm kind of concerned about this change. Not sure why we have not needed this before. But I have not tested it and if it's needed, it does seem fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validated If the pull request is validated for automation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants