From fb94500173135e392d95182b77e7cb9e117e0165 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 28 Apr 2015 11:20:36 +0100 Subject: [PATCH] Bug 1137813 - Part 4. Don't log the cleanup event as the server doesn't accept it after the room has been left. r=mikedeboer --- .../loop/content/shared/js/otSdkDriver.js | 4 +++- .../loop/test/shared/otSdkDriver_test.js | 17 ----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/browser/components/loop/content/shared/js/otSdkDriver.js b/browser/components/loop/content/shared/js/otSdkDriver.js index 902ff11bc5c3..f6c52a365511 100644 --- a/browser/components/loop/content/shared/js/otSdkDriver.js +++ b/browser/components/loop/content/shared/js/otSdkDriver.js @@ -440,7 +440,9 @@ loop.OTSdkDriver = (function() { case "Session.connectionDestroyed": this._metrics.connections--; if (clientType === "local") { - state = "cleanup"; + // Don't log this, as the server doesn't accept it after + // the room has been left. + return; } else if (!this._metrics.connections) { state = "waiting"; } diff --git a/browser/components/loop/test/shared/otSdkDriver_test.js b/browser/components/loop/test/shared/otSdkDriver_test.js index 36ffa7e040c0..5e2392606e9b 100644 --- a/browser/components/loop/test/shared/otSdkDriver_test.js +++ b/browser/components/loop/test/shared/otSdkDriver_test.js @@ -420,23 +420,6 @@ describe("loop.OTSdkDriver", function () { sinon.assert.calledOnce(publisher.destroy); }); - it("should dispatch a ConnectionStatus action", function() { - driver.session = session; - driver._metrics.connections = 1; - - driver.disconnectSession(); - - sinon.assert.calledOnce(dispatcher.dispatch); - sinon.assert.calledWithExactly(dispatcher.dispatch, - new sharedActions.ConnectionStatus({ - event: "Session.connectionDestroyed", - state: "cleanup", - connections: 0, - sendStreams: 0, - recvStreams: 0 - })); - }); - it("should call _noteConnectionLengthIfNeeded with connection duration", function() { driver.session = session; var startTime = 1;