diff --git a/packages/@webex/internal-plugin-mercury/src/mercury.js b/packages/@webex/internal-plugin-mercury/src/mercury.js index 25d0a7bbc69..5c94ebc4265 100644 --- a/packages/@webex/internal-plugin-mercury/src/mercury.js +++ b/packages/@webex/internal-plugin-mercury/src/mercury.js @@ -185,6 +185,8 @@ const Mercury = WebexPlugin.extend({ webSocketUrl.query.multipleConnections = true; } + webSocketUrl.query.clientTimestamp = Date.now(); + return url.format(webSocketUrl); }); }, diff --git a/packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js b/packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js index 275cc9c8494..cd65a870e0c 100644 --- a/packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js +++ b/packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js @@ -447,7 +447,7 @@ describe('plugin-mercury', () => { assert.isFalse(mercury.connecting, 'Mercury is not connecting'); assert.calledWith( Socket.prototype.open, - sinon.match(/ws:\/\/providedurl.com/), + sinon.match(/ws:\/\/providedurl.com.*clientTimestamp[=]\d+/), sinon.match.any ); }); @@ -783,16 +783,16 @@ describe('plugin-mercury', () => { it('uses provided webSocketUrl', () => webex.internal.mercury ._prepareUrl('ws://provided.com') - .then((wsUrl) => assert.match(wsUrl, /provided.com/))); + .then((wsUrl) => assert.match(wsUrl, /.*provided.com.*/))); it('requests text-mode WebSockets', () => webex.internal.mercury ._prepareUrl() - .then((wsUrl) => assert.match(wsUrl, /outboundWireFormat=text/))); + .then((wsUrl) => assert.match(wsUrl, /.*outboundWireFormat=text.*/))); it('requests the buffer state message', () => webex.internal.mercury ._prepareUrl() - .then((wsUrl) => assert.match(wsUrl, /bufferStates=true/))); + .then((wsUrl) => assert.match(wsUrl, /.*bufferStates=true.*/))); it('does not add conditional properties', () => webex.internal.mercury._prepareUrl().then((wsUrl) => {