fix(mercury): handle race condition in mercury plugin to connect if u…#4672
fix(mercury): handle race condition in mercury plugin to connect if u…#4672robstax wants to merge 1 commit intowebex:nextfrom
Conversation
…rls dont match from device
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
| this.connecting = true; | ||
| this.logger.info(`${this.namespace}: reconnecting to new URL after URL mismatch`); | ||
|
|
||
| return this._connectWithBackoff(webSocketUrl); |
There was a problem hiding this comment.
existing code does also this:
this.webex.internal.device.registered || this.webex.internal.device.register() before calling this._connectWithBackoff()
We're not doing this in this new flow - I guess it's because we assume that since we already have currentSocketUrl then it means we must have registered already, so I think it's fine, but just adding a comment to double check that you thought the same.
|
|
||
| mockWebSocket.emit('close', {code: 1000, reason: 'Done'}); | ||
|
|
||
| process.nextTick(() => mockWebSocket.open()); |
There was a problem hiding this comment.
I'm a bit confused by this - why do we need to call this here? doesn't this make the check assert.calledTwice(Socket.prototype.open) that we do later in line 376 pointless because the 2 open() calls are done by the test not the code under test?
…rls dont match from device
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
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.