-
Notifications
You must be signed in to change notification settings - Fork 359
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. It's already being switched off on logout. |
||
this.incomingTaskListener(); | ||
this.taskManager.registerIncomingCallEvent(); | ||
|
||
|
@@ -294,7 +295,6 @@ export default class ContactCenter extends WebexPlugin implements IContactCenter | |
*/ | ||
private setupEventListeners() { | ||
this.services.connectionService.on('connectionLost', this.handleConnectionLost.bind(this)); | ||
this.services.webSocketManager.on('message', this.handleWebSocketMessage); | ||
} | ||
|
||
/** | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Need to add this for relogin as well (in those cases). |
||
} catch (error) { | ||
const {reason, error: detailedError} = getErrorDetails(error, 'silentReLogin', CC_FILE); | ||
if (reason === 'AGENT_NOT_FOUND') { | ||
|
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.