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(wxcc): agent-multi-login-changes #4068

Merged
merged 10 commits into from
Jan 22, 2025
Merged

feat(wxcc): agent-multi-login-changes #4068

merged 10 commits into from
Jan 22, 2025

Conversation

pagour98
Copy link

@pagour98 pagour98 commented Jan 21, 2025

COMPLETES #<SPARK-601180>

This pull request addresses

  • This PR enables agent multi-login alert in CC Widgets by making the below changes in CC SDK.

by making the following changes

  • In config.js file allowMultiLogin boolean flag is set to false, because we don't have to allow multi login similar to CC Desktop.
  • AGENT_MULTI_LOGIN event has been emitted from SDK side, so that widgets can listen to it.

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 >

Tested the agent multi login Websocket event by logging in agent multiple times.
Tested the other functionalities to ensure nothing breaks.
Tested SDK by following the CC SDK test plan suite

Vidcast for the SDK Changes Testing:- https://app.vidcast.io/share/5ad06894-3ead-40db-8441-e4739e4569d3

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.

@pagour98 pagour98 requested a review from a team as a code owner January 21, 2025 07:19
Copy link

coderabbitai bot commented Jan 21, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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. (Beta)
  • @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.

@@ -2,7 +2,7 @@ import {LOGGER} from '@webex/calling';

export default {
cc: {
allowMultiLogin: true,
allowMultiLogin: false,
Copy link
Author

Choose a reason for hiding this comment

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

I have tried to set allowMultiLogin to false in webexConfig object inside CC Widgets but that we not working, So I think we need to set allowMultiLogin to false from SDK side

Copy link
Contributor

Choose a reason for hiding this comment

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

It should work. Approving the PR as still we can debug/test this with false also.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a TODO to fix this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, why do we need this change?

Copy link
Author

@pagour98 pagour98 Jan 22, 2025

Choose a reason for hiding this comment

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

@mkesavan13 , We need this because to tell backend that there should not be multi-login by agent and if there is a multi-login then send AGENT_MULTI_LOGIN event to the client, so that the client know that there is a multi-login.

This will not impact any existing functionality.

@pagour98 pagour98 requested a review from rsarika January 21, 2025 08:14
Copy link
Contributor

@mkesavan13 mkesavan13 left a comment

Choose a reason for hiding this comment

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

Please add the tests enumerated in the PR description as well as a demo vidcast

@@ -2,7 +2,7 @@ import {LOGGER} from '@webex/calling';

export default {
cc: {
allowMultiLogin: true,
allowMultiLogin: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

It should work. Approving the PR as still we can debug/test this with false also.

@rsarika rsarika added the validated If the pull request is validated for automation. label Jan 21, 2025
@pagour98
Copy link
Author

Please add the tests enumerated in the PR description as well as a demo vidcast

@mkesavan13 , Updated the PR description and added Vidcast for the same.

@pagour98 pagour98 requested a review from mkesavan13 January 21, 2025 10:17
@rarajes2
Copy link
Contributor

@pagour98 Let's update the SDK samples to show some notification on the UI for multi-login instead of showing in the console. Let's discuss 1-1 if help/clarification is needed.

@rsarika rsarika self-requested a review January 22, 2025 04:41
Copy link
Contributor

@mkesavan13 mkesavan13 left a comment

Choose a reason for hiding this comment

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

I'd like to know how the flow would look in the Widgets like, after this PR is merged. What SDK method do we call once they confirm? How does the other page get logged out?

@@ -2,7 +2,7 @@ import {LOGGER} from '@webex/calling';

export default {
cc: {
allowMultiLogin: true,
allowMultiLogin: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a TODO to fix this?

@@ -2,7 +2,7 @@ import {LOGGER} from '@webex/calling';

export default {
cc: {
allowMultiLogin: true,
allowMultiLogin: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, why do we need this change?

@pagour98
Copy link
Author

@pagour98 Let's update the SDK samples to show some notification on the UI for multi-login instead of showing in the console. Let's discuss 1-1 if help/clarification is needed.

@rarajes2 , PR has been updated to show notification on samples page when there is agent multi login

@pagour98
Copy link
Author

I'd like to know how the flow would look in the Widgets like, after this PR is merged. What SDK method do we call once they confirm? How does the other page get logged out?

So when we set multilogin to false in sdk, then the server will send the AGENT_MULTI_LOGIN event. If the agent log in second time then the client will receive the event the above event and if the event is received on the existing session we show the alert dialog box and if the confirm is pressed we do web-socket registration again because in case of AGENT_MULTI_LOGIN event the server close down the existing web socket connection. When the agent sigin in new tab, agent-relogin method is called which silently login the agent in new session and the existing session will receive AGENT_MULTI_LOGIN EVENT

@pagour98 pagour98 requested a review from mkesavan13 January 22, 2025 12:10
@pagour98
Copy link
Author

COMPLETES #<SPARK-601180>

This pull request addresses

  • This PR enables agent multi-login alert in CC Widgets by making the below changes in CC SDK.

by making the following changes

  • In config.js file allowMultiLogin boolean flag is set to false, because we don't have to allow multi login similar to CC Desktop.
  • AGENT_MULTI_LOGIN event has been emitted from SDK side, so that widgets can listen to it.

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 >

Tested the agent multi login Websocket event by logging in agent multiple times. Tested the other functionalities to ensure nothing breaks. Tested SDK by following the CC SDK test plan suite

Vidcast for the SDK Changes Testing:- https://app.vidcast.io/share/4a08ebd4-2540-4134-89d7-2279f1ec0c73

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.

@pagour98 pagour98 merged commit 51cdbdb into wxcc Jan 22, 2025
12 checks passed
@pagour98 pagour98 deleted the agent-multi-login branch January 22, 2025 12: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.

5 participants