Bug 1313063 - Only stop observing `dom.push.userAgentID` if we've finished the handshake. r=dragana
authorKit Cambridge <kit@yakshaving.ninja>
Thu, 27 Oct 2016 08:55:50 -0700
changeset 320017 8476b951e74f9e0f4f6e324d2ff8d7ceb79d17f0
parent 320016 2caaf35f549ba8b2931ecbbe0d1f07fddf2cdcd9
child 320018 c73966e96185df03a866f1750867cbd45f1d6b77
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana
bugs1313063
milestone52.0a1
Bug 1313063 - Only stop observing `dom.push.userAgentID` if we've finished the handshake. r=dragana MozReview-Commit-ID: 8yjJfbXHLD5
dom/push/PushServiceWebSocket.jsm
--- a/dom/push/PushServiceWebSocket.jsm
+++ b/dom/push/PushServiceWebSocket.jsm
@@ -336,21 +336,24 @@ this.PushServiceWebSocket = {
   _reconnect: function () {
     console.debug("reconnect()");
     this._shutdownWS(false);
     this._startBackoffTimer();
   },
 
   _shutdownWS: function(shouldCancelPending = true) {
     console.debug("shutdownWS()");
+
+    if (this._currentState == STATE_READY) {
+      prefs.ignore("userAgentID", this);
+    }
+
     this._currentState = STATE_SHUT_DOWN;
     this._skipReconnect = false;
 
-    prefs.ignore("userAgentID", this);
-
     if (this._wsListener) {
       this._wsListener._pushService = null;
     }
     try {
         this._ws.close(0, null);
     } catch (e) {}
     this._ws = null;