Bug 1325523 - Persist tracked IDs on finalization, and don't persist IDs in Sync tests. r=markh
authorKit Cambridge <kit@yakshaving.ninja>
Tue, 07 Feb 2017 11:51:06 -0800
changeset 341172 12f17a36bb1439afca752435457006ad806a593c
parent 341171 7e98eb6b39075766fb5c8f21535a6cbf64e13ce0
child 341173 eb2df73f9e993ba3e37cb065419b4a9b85488fcb
push id37064
push userkcambridge@mozilla.com
push dateTue, 07 Feb 2017 23:47:04 +0000
treeherderautoland@12f17a36bb14 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1325523
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1325523 - Persist tracked IDs on finalization, and don't persist IDs in Sync tests. r=markh MozReview-Commit-ID: CpQP2aM1DO
services/sync/modules/engines.js
services/sync/tests/unit/test_engine.js
services/sync/tests/unit/test_telemetry.js
--- a/services/sync/modules/engines.js
+++ b/services/sync/modules/engines.js
@@ -728,17 +728,18 @@ Engine.prototype = {
    * must have a `validate(engine)` method that returns a promise to an object
    * with a getSummary method). Otherwise return null.
    */
   getValidator() {
     return null;
   },
 
   finalize() {
-    // Ensure the tracker finishes persisting changed IDs to disk.
+    // Persist all pending tracked changes to disk.
+    this._tracker._saveChangedIDs();
     Async.promiseSpinningly(this._tracker._storage.finalize());
   },
 };
 
 this.SyncEngine = function SyncEngine(name, service) {
   Engine.call(this, name || "SyncEngine", service);
 
   this.loadToFetch();
--- a/services/sync/tests/unit/test_engine.js
+++ b/services/sync/tests/unit/test_engine.js
@@ -18,17 +18,18 @@ SteamStore.prototype = {
     this.wasWiped = true;
   }
 };
 
 function SteamTracker(name, engine) {
   Tracker.call(this, name || "Steam", engine);
 }
 SteamTracker.prototype = {
-  __proto__: Tracker.prototype
+  __proto__: Tracker.prototype,
+  persistChangedIDs: false,
 };
 
 function SteamEngine(name, service) {
   Engine.call(this, name, service);
   this.wasReset = false;
   this.wasSynced = false;
 }
 SteamEngine.prototype = {
--- a/services/sync/tests/unit/test_telemetry.js
+++ b/services/sync/tests/unit/test_telemetry.js
@@ -28,17 +28,18 @@ SteamStore.prototype = {
   __proto__: Store.prototype,
 };
 
 function SteamTracker(name, engine) {
   Tracker.call(this, name || "Steam", engine);
 }
 
 SteamTracker.prototype = {
-  __proto__: Tracker.prototype
+  __proto__: Tracker.prototype,
+  persistChangedIDs: false,
 };
 
 function SteamEngine(service) {
   Engine.call(this, "steam", service);
 }
 
 SteamEngine.prototype = {
   __proto__: Engine.prototype,