Bug 615926: Belt-and-braces engine disabling check. r=mconnor
☠☠ backed out by 84fe21efcb57 ☠ ☠
authorRichard Newman <rnewman@mozilla.com>
Mon, 06 Dec 2010 17:23:38 -0800
changeset 58764 13ea9fc20ed2c9390e0dd81a1782b576492f5d6e
parent 58763 1b2d4ba850a9d8d75cc0efc031d227b4365ef741
child 58765 680d3557cafee52e1db57829238e61c8ee3ee42f
push id17416
push userpweitershausen@mozilla.com
push dateTue, 07 Dec 2010 07:05:47 +0000
treeherdermozilla-central@4d16d58becaf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconnor
bugs615926
Bug 615926: Belt-and-braces engine disabling check. r=mconnor
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -1527,16 +1527,25 @@ WeaveSvc.prototype = {
       this.syncThreshold = hasMobile ? MULTI_MOBILE_THRESHOLD : MULTI_DESKTOP_THRESHOLD;
     }
   },
 
   _updateEnabledEngines: function _updateEnabledEngines() {
     let meta = Records.get(this.metaURL);
     if (meta.isNew || !meta.payload.engines)
       return;
+    
+    // If we're the only client, and no engines are marked as enabled,
+    // thumb our noses at the server data: it can't be right.
+    // Belt-and-suspenders approach to Bug 615926.
+    if ((this.numClients <= 1) &&
+        ([e for (e in meta.payload.engines) if (e != "clients")].length == 0)) {
+      this._log.info("One client and no enabled engines: not touching local engine status.");
+      return;
+    }
 
     this._ignorePrefObserver = true;
 
     let enabled = [eng.name for each (eng in Engines.getEnabled())];
     for (let engineName in meta.payload.engines) {
       let index = enabled.indexOf(engineName);
       if (index != -1) {
         // The engine is enabled locally. Nothing to do.