Skip to content

Conversation

seshgirik
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.

@seshgirik seshgirik requested a review from a team as a code owner August 5, 2025 09:32
Copy link
Contributor

coderabbitai bot commented Aug 5, 2025

📝 Walkthrough

Walkthrough

The changes enforce the use of a hardcoded Mobius URL in two locations within the codebase. In the Call class constructor, the mobiusUrl property is now always set to a specific URL, overriding any dynamic value passed in. Similarly, the setActiveMobiusUrl method in the Registration class now assigns the same hardcoded URL to its internal state, disregarding the input parameter. Additionally, the attemptRegistrationWithServers method is modified to use only this fixed URL for registration attempts, ignoring any other server lists. No changes were made to method signatures, exported entities, or control flow beyond these assignments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 2e1f776 and 70cc6c1.

📒 Files selected for processing (2)
  • packages/calling/src/CallingClient/calling/call.ts (1 hunks)
  • packages/calling/src/CallingClient/registration/register.ts (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/calling/src/CallingClient/calling/call.ts
🧰 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.
📚 Learning: in `packages/calling/src/callingclient/constants.ts`, when validating phone numbers using `valid_pho...
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.

Applied to files:

  • packages/calling/src/CallingClient/registration/register.ts
📚 Learning: in the `updateanswercallscrossclient` method in the `usersub` class (`packages/@webex/internal-plugi...
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.

Applied to files:

  • packages/calling/src/CallingClient/registration/register.ts
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
  • 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.

Support

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

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 generate unit tests to generate unit tests 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cf686d7 and 2e1f776.

📒 Files selected for processing (2)
  • packages/calling/src/CallingClient/calling/call.ts (1 hunks)
  • packages/calling/src/CallingClient/registration/register.ts (1 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.
📚 Learning: in `packages/calling/src/callingclient/constants.ts`, when validating phone numbers using `valid_pho...
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.

Applied to files:

  • packages/calling/src/CallingClient/calling/call.ts
  • packages/calling/src/CallingClient/registration/register.ts
📚 Learning: in the `updateanswercallscrossclient` method in the `usersub` class (`packages/@webex/internal-plugi...
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.

Applied to files:

  • packages/calling/src/CallingClient/calling/call.ts
⏰ 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
🔇 Additional comments (1)
packages/calling/src/CallingClient/registration/register.ts (1)

135-143: Replace hardcoded Mobius URLs with configurable values

Hardcoding the Prod Mobius endpoint in two places breaks the method contract, ties the code to one environment, and hamstrings testing. Let’s centralize this URL and respect the incoming parameter:

packages/calling/src/CallingClient/registration/register.ts

  • Remove the line
    url = "https://mobius.afrawxt-prd-2.prod.infra.webex.com/api/v1/calling/web/";
  • Derive the active URL from either an environment variable or the passed-in url

packages/calling/src/CallingClient/calling/call.ts

  • Remove the hardcoded assignment
    this.mobiusUrl = "https://mobius.afrawxt-prd-2.prod.infra.webex.com/api/v1/calling/web/";
  • Use the URL from configuration or the caller

Suggested pattern:

 public setActiveMobiusUrl(inputUrl: string) {
-  // Hardcoded production URL — remove this
-  inputUrl = "https://mobius.afrawxt-prd-2.prod.infra.webex.com/api/v1/calling/web/";
+  // Prefer an environment override, else fall back to the provided URL
+  const mobiusUrl = process.env.MOBIUS_URL ?? inputUrl;

   log.info(`${METHOD_START_MESSAGE} with ${mobiusUrl}`, {
     method: METHODS.UPDATE_ACTIVE_MOBIUS,
     file: REGISTRATION_FILE,
   });
-  this.activeMobiusUrl = inputUrl;
-  this.callManager.updateActiveMobius(inputUrl);
+  this.activeMobiusUrl = mobiusUrl;
+  this.callManager.updateActiveMobius(mobiusUrl);
 }

Repeat the same adjustment in call.ts. This ensures:

  1. Callers control the URL
  2. Environments can override without code changes
  3. Tests can inject mocks easily

[fіx_required]

Copy link

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

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

@seshgirik seshgirik changed the title mobius prod afra wxt-prod2 Hardcoded mobius prod afra wxt-prod2 URL Aug 5, 2025
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