Skip to content

Conversation

@adhmenon
Copy link
Contributor

COMPLETES #< SPARK-468090>

This pull request addresses

  • Right now, we have support for using joinLink to create meetings, for eg. https://cisco.webex.com/cisco/j.php?MTID=m6dfc73927ea656a2f9b5637c32a2dac5
  • However, the SDK level prasing fails for certain cases, due to incorrect checks.

by making the following changes

  • Code has been added to improve the parsing.
  • We simply check for the joinLink params in both pathname and search (ie MTID) to validate.
  • Unit tests were added

Vidcast

https://app.vidcast.io/share/9aa6185b-6d9a-41ee-8e4f-4fa1069d28e3

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

  • Tested with different types of join links which had cisco and non-cisco domains.
  • Tested with bad links which did not have MTID and ensured meeting was not created.
  • Ensured it did not break the current meeting link creation.

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.

@adhmenon adhmenon requested review from a team as code owners February 24, 2025 08:37
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2025

📝 Walkthrough

Walkthrough

This pull request introduces a new constant, JOIN_LINK_MTID, with the value 'MTID', to the constants.ts file. The MeetingInfoUtil class is updated to include this constant in the isMeetingLink method, which now checks if the search parameters contain JOIN_LINK_MTID in addition to existing conditions. This modification broadens the criteria for validating meeting links. Additionally, a new test suite is added for the isMeetingLink method, which includes three test cases that validate its functionality with various meeting link formats, ensuring that the method correctly identifies valid and invalid links based on the presence of the MTID parameter.

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.

🔧 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-config > [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/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 > [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-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning workspace-aggregator-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > [email protected]: 16.1.1
warning workspace-aggregator-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > @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-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > @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-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > @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-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > @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-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > @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-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > @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-c72c93da-a0f2-4ab9-a9c3-dc1c83b40b9e > @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 50a861b and c4bd2e6.

📒 Files selected for processing (1)
  • packages/@webex/plugin-meetings/src/constants.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/@webex/plugin-meetings/src/constants.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build Packages
  • GitHub Check: AWS Amplify Console Web Preview

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 generate docstrings to generate docstrings for this 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.

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.

@adhmenon adhmenon added the validated If the pull request is validated for automation. label Feb 24, 2025

export const JOIN = 'join';

export const JOIN_LINK = 'j.php';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to add this - no other way to check for the join link...

Copy link
Contributor

Choose a reason for hiding this comment

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

Were we able to get to the right team to verify this one?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes. we need to confirm we always get j.php? any doc reference?

Copy link
Contributor Author

@adhmenon adhmenon Feb 24, 2025

Choose a reason for hiding this comment

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

parsedUrl.pathname.includes(`/${JOIN}`));
parsedUrl.pathname.includes(`/${JOIN}`) ||
(parsedUrl.pathname.includes(`/${JOIN_LINK}`) &&
parsedUrl.search.includes(JOIN_LINK_MTID)));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will only check if both exists at the same time - hence the &&.

Copy link
Contributor

Choose a reason for hiding this comment

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

Again, we need to confirm if MITD is the only type of query param there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For joinLink this parameter will be there by default. Hence, we only need to check for this, have updated the code and added a comment also.

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 (1)
packages/@webex/plugin-meetings/test/unit/spec/meeting-info/utilv2.js (1)

349-364: Good test coverage, consider adding more edge cases.

The test suite effectively validates the core functionality of join link parsing. However, consider adding tests for:

  • Links without query parameters
  • Links with empty MTID values
  • Links with multiple query parameters
  • Links with malformed j.php paths
it('should return false for join link without query parameters', () => {
  const result = MeetingInfoUtil.isMeetingLink('https://cisco.webex.com/cisco/j.php');
  expect(result).to.be.false;
});

it('should return false for join link with empty MTID', () => {
  const result = MeetingInfoUtil.isMeetingLink('https://cisco.webex.com/cisco/j.php?MTID=');
  expect(result).to.be.false;
});

it('should return true for join link with additional query params', () => {
  const result = MeetingInfoUtil.isMeetingLink('https://cisco.webex.com/cisco/j.php?MTID=abc123&other=param');
  expect(result).to.be.true;
});

it('should return false for malformed j.php path', () => {
  const result = MeetingInfoUtil.isMeetingLink('https://cisco.webex.com/cisco/j.php.invalid?MTID=abc123');
  expect(result).to.be.false;
});
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f5f2b13 and 82c9216.

📒 Files selected for processing (3)
  • packages/@webex/plugin-meetings/src/constants.ts (1 hunks)
  • packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts (2 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting-info/utilv2.js (1 hunks)
🔇 Additional comments (2)
packages/@webex/plugin-meetings/src/constants.ts (1)

39-40: LGTM! Well-defined constants for join link parsing.

The new constants JOIN_LINK and JOIN_LINK_MTID are appropriately defined to handle join links with the format 'j.php?MTID=...'.

packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts (1)

75-77: LGTM! Robust join link validation logic.

The enhanced validation correctly handles both standard meeting links and join links with MTID parameter. The use of && ensures that j.php links must have both the correct pathname and MTID parameter.

@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-4114.d3m3l2kee0btzx.amplifyapp.com

@rarajes2
Copy link
Contributor

What was the issue with the Leave? Were you able to fix that?

@adhmenon
Copy link
Contributor Author

What was the issue with the Leave? Were you able to fix that?

I am still trying to find the root cause... seems to be something related to the remote media disconnect...

@adhmenon
Copy link
Contributor Author

Note
Turns out we only need to check for MTID in the search parameter of the url. That is enough to determine the validity of the join link it seems.

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 (1)
packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts (1)

74-75: Consider using optional chaining for better readability and safety.

The code change correctly implements the logic to check for both join links in the pathname and MTID in search parameters. However, the boolean check can be improved for better readability and safety.

          parsedUrl.pathname.includes(`/${MEET_CISCO}`) ||
          parsedUrl.pathname.includes(`/${MEET_CO}`) ||
          parsedUrl.pathname.includes(`/${JOIN}`) ||
-          (parsedUrl.search && parsedUrl.search.includes(JOIN_LINK_MTID)));
+          parsedUrl.search?.includes(JOIN_LINK_MTID));

Could you add a comment explaining that for joinLink, the MTID parameter is sufficient for validation? This would help future maintainers understand the rationale behind this check, as indicated in your previous comment.

🧰 Tools
🪛 Biome (1.9.4)

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2eaf757 and 50a861b.

📒 Files selected for processing (1)
  • packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts (2 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build Packages
  • GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (2)
packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts (2)

22-22: Import addition looks good.

The addition of JOIN_LINK_MTID to the imports is consistent with the PR objective of enhancing join link parsing.


62-79:

✅ Verification successful

Verify that all test cases are covered.

The implementation looks good for validating meeting links. The improved logic now checks for either JOIN in the pathname or MTID in the search parameters, which should handle the various join link formats mentioned in the PR description.

Run the following tests to ensure the changes properly handle all the join link scenarios:


🏁 Script executed:

#!/bin/bash
# Look for test cases that verify the updated isMeetingLink functionality

echo "Searching for test cases for isMeetingLink..."
rg -A 10 "isMeetingLink" --type js packages/@webex/plugin-meetings/test/unit/spec

Length of output: 2261


Meeting Link Validation Tests Verified

The implementation correctly checks both the hostname and pathname/search conditions, and the existing tests in packages/@webex/plugin-meetings/test/unit/spec/meeting-info/utilv2.js adequately cover the key scenarios (valid join meeting links with and without Cisco domain using MTID, as well as invalid links).

  • Test cases verify:
    • A valid join meeting link with MTID.
    • A valid join meeting link without the Cisco-specific domain.
    • An invalid meeting link where the query parameter doesn’t match.

No further changes are required.

🧰 Tools
🪛 Biome (1.9.4)

[error] 65-65: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

@adhmenon adhmenon merged commit fc8c62a into webex:next Feb 27, 2025
13 checks passed
@adhmenon adhmenon deleted the join-link branch February 27, 2025 06:16
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