-
Notifications
You must be signed in to change notification settings - Fork 358
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
fix(cc-sdk): fixed-websocket-on-message-event-remove-logout #4044
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -194,6 +194,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter | |||
|
|||
await loginResponse; | |||
|
|||
this.services.webSocketManager.on('message', this.handleWebSocketMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will not affect any other functionality as it is only handling AGENT_STATE_CHANGE
event. We were earlier listening to web socket events during register which would not have worked.
Checked that it works cleanly in the sample app.
@@ -355,6 +355,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter | |||
|
|||
await this.handleDeviceType(deviceType as LoginOption, dn); | |||
this.agentConfig.isAgentLoggedIn = true; | |||
this.services.webSocketManager.on('message', this.handleWebSocketMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add this for relogin as well (in those cases).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, Adhwaith. Looks good to me. A test for the exact case where you found the issue: "Doing a station logout and logging in back didn't listen to the event" would be a good addition
@@ -194,6 +194,7 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter | |||
|
|||
await loginResponse; | |||
|
|||
this.services.webSocketManager.on('message', this.handleWebSocketMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would we be switching off these listeners? Is that already taken care of somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already being switched off on logout.
COMPLETES #< SPARK-592068 >
This pull request addresses
by making the following changes
Vidcast of working widgets - https://app.vidcast.io/share/a1cac1b3-83ec-450d-9e63-4a3066287b93
Change Type
The following scenarios were tested
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.