Skip to content

Conversation

kavirupa
Copy link

COMPLETES #< INSERT LINK TO ISSUE >

This pull request addresses

< DESCRIBE THE CONTEXT OF THE ISSUE >

by making the following changes

< DESCRIBE YOUR CHANGES >

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 >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

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.

@kavirupa kavirupa requested a review from a team as a code owner July 16, 2025 05:18
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

📝 Walkthrough

Walkthrough

The changes update how the Mobius URL is handled in both the Call and Registration classes. In the Call class constructor, the mobiusUrl property is now always set to a specific hardcoded URL, ignoring the activeUrl parameter. Similarly, in the Registration class, the methods setActiveMobiusUrl and attemptRegistrationWithServers have been modified to override any provided URLs or server arrays with the same fixed Mobius URL. No other logic, control flow, or method signatures are affected by these modifications.

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...
(node:5597) [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for url.parse() vulnerabilities.
(Use node --trace-deprecation ... to show where the warning was created)
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 m

... [truncated 7274 characters] ...

[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-5414eeb1-7a0e-472b-abbc-dff843d1cc5b > @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 "24.3.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 54b683f and c58a14a.

📒 Files selected for processing (2)
  • packages/calling/src/CallingClient/calling/call.ts (1 hunks)
  • packages/calling/src/CallingClient/registration/register.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: robstax
PR: webex/webex-js-sdk#3948
File: packages/@webex/webex-core/test/unit/spec/webex-core.js:178-254
Timestamp: 2024-11-01T00:30:53.442Z
Learning: In the webex-js-sdk project, when reviewing changes in `packages/@webex/webex-core/test/unit/spec/webex-core.js`, if the user declines to add negative test cases for invalid interceptor configurations, accept their decision and do not insist.
packages/calling/src/CallingClient/calling/call.ts (1)
Learnt from: sreenara
PR: webex/webex-js-sdk#3904
File: packages/calling/src/CallingClient/constants.ts:59-59
Timestamp: 2024-10-24T10:00:26.858Z
Learning: In `packages/calling/src/CallingClient/constants.ts`, when validating phone numbers using `VALID_PHONE_REGEX`, prefer to keep the permissive regex `/[\d\s()*#+.-]+/`, as the call processing agent will handle any invalid phone numbers. Do not enforce stricter phone number validation in the client code.
packages/calling/src/CallingClient/registration/register.ts (3)
Learnt from: sreenara
PR: webex/webex-js-sdk#3904
File: packages/calling/src/CallingClient/constants.ts:59-59
Timestamp: 2024-10-24T10:00:26.858Z
Learning: In `packages/calling/src/CallingClient/constants.ts`, when validating phone numbers using `VALID_PHONE_REGEX`, prefer to keep the permissive regex `/[\d\s()*#+.-]+/`, as the call processing agent will handle any invalid phone numbers. Do not enforce stricter phone number validation in the client code.
Learnt from: robstax
PR: webex/webex-js-sdk#3948
File: packages/@webex/webex-core/test/unit/spec/webex-core.js:178-254
Timestamp: 2024-11-01T00:30:53.442Z
Learning: In the webex-js-sdk project, when reviewing changes in `packages/@webex/webex-core/test/unit/spec/webex-core.js`, if the user declines to add negative test cases for invalid interceptor configurations, accept their decision and do not insist.
Learnt from: mmulcair1981
PR: webex/webex-js-sdk#3936
File: packages/@webex/internal-plugin-usersub/src/usersub.ts:65-66
Timestamp: 2024-10-24T08:50:23.626Z
Learning: In the `updateAnswerCallsCrossClient` method in the `Usersub` class (`packages/@webex/internal-plugin-usersub/src/usersub.ts`), the `deviceId` can be empty, and the request should not be rejected in this case.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: AWS Amplify Console Web Preview


return abort;
}
servers = ["https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"];
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove hardcoded servers override that defeats the method's purpose.

This hardcoded array assignment completely ignores the servers parameter and makes the method's failover logic meaningless since only one server is ever used. This breaks the method's contract and makes testing impossible.

The method is designed to handle multiple servers for failover scenarios, but this change eliminates that capability entirely. If this is for validation testing, consider:

  • Using environment-specific configuration
  • Adding a validation mode flag
  • Creating a dedicated testing endpoint
-    servers = ["https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"];
+    // TODO: Remove hardcoded servers override before production merge
+    // servers = ["https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
servers = ["https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"];
// TODO: Remove hardcoded servers override before production merge
// servers = ["https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"];
🤖 Prompt for AI Agents
In packages/calling/src/CallingClient/registration/register.ts at line 641,
remove the hardcoded assignment of the servers array that overrides the input
parameter. This override disables the method's failover logic by forcing a
single server, breaking its intended functionality. Instead, rely on the
passed-in servers parameter or implement environment-specific configuration or a
validation mode flag if testing with fixed servers is needed.

}

public setActiveMobiusUrl(url: string) {
url = "https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove hardcoded URL override that breaks method contract.

This hardcoded URL assignment completely ignores the url parameter, making the method signature misleading and breaking its contract. Callers would expect their provided URL to be used.

If this is for temporary validation testing, consider these alternatives:

  • Use environment variables or configuration files
  • Add a feature flag or debug mode
  • Create a separate validation-specific method
-    url = "https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"
+    // TODO: Remove hardcoded URL override before production merge
+    // url = "https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
url = "https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"
// TODO: Remove hardcoded URL override before production merge
// url = "https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/"
🤖 Prompt for AI Agents
In packages/calling/src/CallingClient/registration/register.ts at line 136,
remove the hardcoded URL assignment that overrides the method's url parameter.
Instead, ensure the method uses the url parameter passed to it, preserving the
method contract. If a specific URL is needed for testing, implement it via
environment variables, configuration, feature flags, or a separate validation
method rather than hardcoding it here.

this.localRoapMessage = {} as RoapMessage;

this.mobiusUrl = activeUrl;
this.mobiusUrl = "https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/";
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid hardcoding URLs - use configuration-based approach instead.

Hardcoding the Mobius URL to a specific cluster endpoint violates configuration management principles and creates several issues:

  • Makes the code inflexible across different environments
  • Ignores the activeUrl parameter passed to the constructor, causing confusion
  • Couples the code to a specific infrastructure endpoint (au-vicrtm1)
  • Could lead to deployment issues if this code reaches other environments

For validation testing, consider:

  1. Using environment variables or configuration files
  2. Adding a feature flag to conditionally override the URL
  3. Implementing this change at the deployment/configuration level rather than in the code
-    this.mobiusUrl = "https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/";
+    this.mobiusUrl = process.env.MOBIUS_URL_OVERRIDE || activeUrl;

Alternatively, if this is specifically for validation purposes, consider implementing a feature flag mechanism or moving this logic to a configuration layer.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
this.mobiusUrl = "https://mobius.au-vicrtm1.a5.prod.infra.webex.com/api/v1/calling/web/";
this.mobiusUrl = process.env.MOBIUS_URL_OVERRIDE || activeUrl;
🤖 Prompt for AI Agents
In packages/calling/src/CallingClient/calling/call.ts at line 237, avoid
hardcoding the Mobius URL directly in the code. Instead, refactor to use a
configuration-based approach by retrieving the URL from environment variables,
configuration files, or constructor parameters like the existing activeUrl.
Optionally, implement a feature flag to override the URL for validation
purposes. This will make the code flexible across environments and decouple it
from a specific infrastructure endpoint.

Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant