Skip to content

Conversation

@johnsoter13
Copy link
Contributor

COMPLETES #< https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-645973 >

This pull request addresses

Users are not able to enable static meeting links for a conversation currently

by making the following changes

  • allows users to enable static meeting link for a conversation
  • creates helper function to call appApi endpoint for creating space meeting and enabling static meeting link

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.

@johnsoter13 johnsoter13 requested review from a team as code owners April 7, 2025 20:51
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 7, 2025

📝 Walkthrough

Walkthrough

This pull request introduces two new error classes to handle specific error cases encountered when enabling static meeting links. The existing meeting creation method is refactored into a new method that supports both adhoc meeting creation and static link enabling based on an additional boolean parameter. A dedicated public method is added for enabling static meeting links, which includes specific error handling logic that throws one of the new error classes depending on the error encountered. Additionally, new behavioral metric constants are defined to track the success or failure of enabling static meeting links and related error conditions. The corresponding unit tests have been updated and expanded to cover the new functionality and error scenarios, ensuring both the meeting creation and static link enabling processes are properly validated.

Possibly related PRs

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.

🔧 ast-grep (0.31.1)
packages/@webex/plugin-meetings/test/unit/spec/meeting-info/meetinginfov2.js
🔧 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.

yarn install v1.22.22
[1/4] Resolving packages...
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/core > @jest/reporters > [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-config > [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 sinon > @sinonjs/samsam > [email protected]: This package is deprecated. Use the optional chaining (?.) operator instead.
warning wd > archiver > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > archiver > archiver-utils > [email protected]: Glob versions prior to v9 are no longer supported
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 > [email protected]: request has been deprecated, see request/request#3142
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-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning workspace-aggregator-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > [email protected]: 16.1.1
warning workspace-aggregator-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > @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-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > @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-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > @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-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > @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-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > @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-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > @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-ea8d5514-d7fc-48f3-b66f-a1b186e74e53 > @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.
[2/4] Fetching packages...
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.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba90ca8 and 6dd86cb.

📒 Files selected for processing (2)
  • packages/@webex/plugin-meetings/src/meeting-info/meeting-info-v2.ts (6 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting-info/meetinginfov2.js (21 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/@webex/plugin-meetings/test/unit/spec/meeting-info/meetinginfov2.js (2)
packages/@webex/plugin-meetings/src/meeting-info/meeting-info-v2.ts (3)
  • MeetingInfoV2MeetingIsInProgressError (201-223)
  • MeetingInfoV2StaticMeetingLinkAlreadyExists (228-245)
  • MeetingInfoV2JoinForbiddenError (176-196)
packages/@webex/plugin-meetings/src/constants.ts (2)
  • DESTINATION_TYPE (1400-1409)
  • DESTINATION_TYPE (1411-1411)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Determine Changed Packages
  • GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (20)
packages/@webex/plugin-meetings/test/unit/spec/meeting-info/meetinginfov2.js (13)

10-10: LGTM: Added required constants import

Added DESTINATION_TYPE and WBXAPPAPI_SERVICE imports needed for the new test cases.


20-21: Good: Imported new error classes

The imports match the new error classes implemented in the source file to handle specific error scenarios when enabling static meeting links.


95-110: LGTM: Helper setup function

Well-structured helper function that creates an array of invitees based on conversation participants, following the same pattern used in other tests.


112-152: LGTM: Happy path test case

Good test coverage for the successful enabling of a static meeting link. The test verifies:

  1. The conversation retrieval call
  2. The API request to enable the static meeting link
  3. Metric sending
  4. The expected result structure

154-170: LGTM: Error handling for missing webex site

Good test case that verifies the functionality fails correctly when no preferred webex site is set.


172-189: LGTM: Error handling for in-progress meeting

Good test case for verifying the proper handling of the specific error code (33003) when a meeting is in progress, including error instance validation and metric sending.


191-208: LGTM: Error handling for existing static link

Good test case for verifying the proper handling of the specific error code (409000) when a static meeting link already exists, including error instance validation and metric sending.


210-225: LGTM: Generic error handling

Good test case for handling generic errors when enabling static links, ensuring the appropriate failure metric is sent.


958-959: Minor style improvement

This line was changed from just return invitee; to include an object destructuring pattern to be consistent with how the value is used in the tests.


969-975: LGTM: Improved test case assertion

Enhanced test case for creating adhoc space meetings to include verification of the conversation URL request parameters.


986-987: LGTM: Updated test parameters

Updated to explicitly set installedOrgID and schedule parameters in the test assertion to match implementation changes.


1019-1019: LGTM: Updated test expectation

Added the schedule: false parameter to the expected request body to match the implementation changes.


1104-1132: LGTM: Additional error code test

Good addition of test case for error code 403003 to verify MeetingInfoV2JoinForbiddenError handling.

packages/@webex/plugin-meetings/src/meeting-info/meeting-info-v2.ts (7)

19-20: LGTM: New error message constants

Well-defined constants for error messages that will be reused in the new error classes.


198-223: LGTM: New error class for in-progress meetings

Well-implemented error class that follows the existing pattern and extends Error with specific properties needed for this error case. The enable parameter is a good addition to provide context about the operation that was being attempted.


225-245: LGTM: New error class for existing static links

Well-implemented error class that follows the existing pattern and extends Error with specific properties needed for this error case.


346-360: Good refactoring: Method with added functionality

Well-refactored method that maintains backward compatibility while adding support for enabling static meeting links through the enableStaticMeetingLink parameter.


386-386: LGTM: Schedule parameter based on function purpose

Good implementation that sets the schedule parameter based on whether we're enabling a static meeting link (true) or creating an adhoc meeting (false).


405-435: LGTM: Original method preserved

Good approach to maintain backward compatibility by preserving the original method name and having it delegate to the refactored method with the correct parameters.


437-484: LGTM: New method implementation

Well-implemented method for enabling static meeting links with appropriate error handling for specific error cases:

  1. 403 status code: Meeting is in progress
  2. 409 status code: Static meeting link already exists
  3. Other errors: Generic failure

The method also correctly sends behavioral metrics for success and different failure scenarios.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

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.

@johnsoter13 johnsoter13 added the validated If the pull request is validated for automation. label Apr 7, 2025
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 (3)
packages/@webex/plugin-meetings/src/metrics/constants.ts (1)

51-54: Typo in constant names ENABLE_STATIC_METTING_LINK_*.

There appears to be a typo in the constant names - "METTING" should be "MEETING".

-  ENABLE_STATIC_METTING_LINK_SUCCESS: 'js_sdk_enable_static_meeting_link_success',
-  ENABLE_STATIC_METTING_LINK_FAILURE: 'js_sdk_enable_static_meeting_link_failure',
+  ENABLE_STATIC_MEETING_LINK_SUCCESS: 'js_sdk_enable_static_meeting_link_success',
+  ENABLE_STATIC_MEETING_LINK_FAILURE: 'js_sdk_enable_static_meeting_link_failure',
packages/@webex/plugin-meetings/src/meeting-info/meeting-info-v2.ts (2)

451-458: Consider using common error handlers for consistency

While this implementation works correctly, consider leveraging the existing error handlers (handlePolicyError, handleJoinWebinarError, handleForbiddenError) for consistency across the codebase.

.catch((err) => {
  if (err?.statusCode === 403) {
+   this.handlePolicyError(err);
+   this.handleJoinWebinarError(err);
+   this.handleForbiddenError(err);
+   
    Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_IS_IN_PROGRESS_ERROR, {
      reason: err.message,
      stack: err.stack,
    });

    throw new MeetingInfoV2MeetingIsInProgressError(err.body?.code, err.body?.message);
  }

460-470: Consider making error handling more extensible

The current error handling implementation uses if-else statements for each status code. As more error types are added, this could become harder to maintain.

Consider using a map-based approach for error handling:

const errorHandlers = {
    Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_IS_IN_PROGRESS_ERROR, {
      reason: err.message,
      stack: err.stack,
    });
    throw new MeetingInfoV2MeetingIsInProgressError(err.body?.code, err.body?.message);
  },
    Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.STATIC_MEETING_LINK_ALREADY_EXISTS_ERROR, {
      reason: err.message,
      stack: err.stack,
    });
    throw new MeetingInfoV2StaticMeetingLinkAlreadyExists(err.body?.code, err.body?.message);
  }
};

// Usage
const handler = errorHandlers[err?.statusCode];
if (handler) {
  handler(err);
} else {
  // Default error handling
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f277d0 and ba90ca8.

📒 Files selected for processing (5)
  • packages/@webex/plugin-meetings/src/meeting-info/meeting-info-v2.ts (6 hunks)
  • packages/@webex/plugin-meetings/src/meetings/index.ts (1 hunks)
  • packages/@webex/plugin-meetings/src/metrics/constants.ts (1 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting-info/meetinginfov2.js (21 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meetings/index.js (2 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
packages/@webex/plugin-meetings/src/meetings/index.ts (2)
packages/@webex/plugin-meetings/src/meeting/index.ts (1)
  • Meeting (540-9450)
packages/@webex/plugin-meetings/src/index.ts (1)
  • Meeting (72-72)
packages/@webex/plugin-meetings/test/unit/spec/meeting-info/meetinginfov2.js (2)
packages/@webex/plugin-meetings/src/meeting-info/meeting-info-v2.ts (3)
  • MeetingInfoV2MeetingIsInProgressError (201-218)
  • MeetingInfoV2StaticMeetingLinkAlreadyExists (223-240)
  • MeetingInfoV2JoinForbiddenError (176-196)
packages/@webex/plugin-meetings/src/constants.ts (2)
  • DESTINATION_TYPE (1400-1409)
  • DESTINATION_TYPE (1411-1411)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build Packages
  • GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (23)
packages/@webex/plugin-meetings/src/meetings/index.ts (1)

1372-1394: Good implementation of the enableStaticMeetingLink method

The implementation is clean, follows existing code patterns, and has appropriate error handling. This method correctly delegates the functionality to the meetingInfo object.

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

935-955: Well-structured tests for the new enableStaticMeetingLink method

The test coverage is good and verifies both the existence of the method and that it correctly calls the meetingInfo.enableStaticMeetingLink method with the appropriate parameters.

packages/@webex/plugin-meetings/test/unit/spec/meeting-info/meetinginfov2.js (14)

10-10: Added necessary constant imports

This line adds imports for DESTINATION_TYPE and WBXAPPAPI_SERVICE constants that will be used in the new tests.


20-21: Added new error class imports

These new error class imports are correctly added to support the new tests for enabling static meeting links.


95-110: Well-structured setup function for test data

The setup function properly creates an array of invitees from the conversation participants data, which will be reused across multiple tests.


112-152: Test case validates successful static meeting link enabling

This test successfully validates that:

  1. The correct API requests are made with the expected parameters
  2. The appropriate success metric is sent
  3. The expected result is returned with the conversation data

The test verifies that schedule: true is passed to enable static meeting link functionality.


154-170: Test case handles missing preferred webex site correctly

This test correctly verifies that the method throws an appropriate error when the preferred webex site is undefined, preventing unnecessary API requests.


172-189: Test case properly validates meeting in progress error handling

This test effectively verifies that:

  1. The correct error is thrown when a 403 status code with error code 33003 is received
  2. The appropriate error metrics are sent
  3. The error message is correctly constructed

The test ensures proper error handling for when a meeting is already in progress.


191-208: Test case properly validates static meeting link already exists error handling

This test effectively verifies that:

  1. The correct error is thrown when a 409 status code with error code 409000 is received
  2. The appropriate error metrics are sent
  3. The error message is correctly constructed

The test ensures proper error handling for when a static meeting link already exists.


210-225: Test case properly validates generic error handling

This test ensures that for unhandled error types, the appropriate failure metric is sent, which is important for tracking and debugging purposes.


286-291: Reformatted test case for better readability

The existing test cases for fetchMeetingInfo have been reformatted for better readability and consistency, without changing functionality.

Also applies to: 296-299


958-959: Minor formatting update to return statement

Reformatted the return statement in the setup function to maintain consistent code style.


969-976: Assertion updated for createAdhocSpaceMeeting to verify correct API calls

This assertion has been properly updated to ensure the method makes the expected API requests.


987-988: Added schedule parameter to createAdhocSpaceMeeting

The schedule: false parameter has been added to ensure that the refactored method correctly distinguishes between adhoc meetings and static meeting links.


994-995: Updated expected result assertion

The assertion has been updated to include the expected statusCode in the result.


1104-1132: Test case for MeetingInfoV2JoinForbiddenError

This test properly verifies the error handling for JOIN_FORBIDDEN_CODES, ensuring that the correct error type is thrown with the appropriate message and metrics.

packages/@webex/plugin-meetings/src/meeting-info/meeting-info-v2.ts (7)

19-20: Added new error message constants

Well-defined constants for the error messages that will be used by the new error classes.


198-218: New error class for meeting in progress scenarios

This class properly extends Error and follows the pattern of other error classes in the file, with appropriate properties and constructor. It will be used when attempting to enable a static meeting link for a conversation that has an active meeting.


220-240: New error class for existing static meeting link scenarios

This class properly extends Error and follows the pattern of other error classes in the file, with appropriate properties and constructor. It will be used when attempting to enable a static meeting link that already exists.


341-355: Refactored method to support both adhoc meetings and static meeting links

The method has been well refactored to handle both use cases by adding a boolean parameter enableStaticMeetingLink. The parameter name is clear and the default value maintains backward compatibility.

The inline comment explaining the parameter purpose is helpful.


381-382: Key change to support static meeting links

This line sets the schedule property to the value of enableStaticMeetingLink, which determines whether to create an adhoc meeting (false) or enable a static meeting link (true).


408-430: Updated createAdhocSpaceMeeting to use refactored method

The original method now properly checks for the preferred webex site and delegates to the refactored method with the appropriate parameter value (false) to maintain backward compatibility.


432-479: New method to enable static meeting links

The new method provides a public API for enabling static meeting links. It includes:

  1. Verification of the preferred webex site
  2. Calling the refactored method with the appropriate parameter value (true)
  3. Sending appropriate metrics for success/failure
  4. Specific error handling for 403 (meeting in progress) and 409 (static meeting link already exists) status codes

The error handling approach is straightforward and matches the implementation in the test file.

@aws-amplify-us-east-2
Copy link

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

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

Copy link
Contributor

@stanjiawang stanjiawang left a comment

Choose a reason for hiding this comment

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

Pulled the code and tested it locally, it works fine for me.

@chrisadubois chrisadubois merged commit fe90544 into webex:next Apr 10, 2025
4 of 5 checks passed
This was referenced Apr 10, 2025
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.

4 participants