Bug 1452294 - Improve logging for records in bookmark mirror. r=markh
authorKit Cambridge <kit@yakshaving.ninja>
Fri, 06 Apr 2018 17:15:28 -0700
changeset 412894 141144c1794db439f6fb39dfaaeab08d23855e63
parent 412893 22ebb890e8ede5d3b87c2e600bbd01c2fa9281b0
child 412895 96f5608910e23ccbbd52cbdd868e006926ef8fb5
push id33823
push userebalazs@mozilla.com
push dateThu, 12 Apr 2018 09:38:35 +0000
treeherdermozilla-central@abd91e812e7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1452294
milestone61.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 1452294 - Improve logging for records in bookmark mirror. r=markh MozReview-Commit-ID: 69eJrbo89Sx
services/sync/tests/unit/test_bookmark_engine.js
toolkit/components/places/SyncedBookmarksMirror.jsm
toolkit/components/places/tests/sync/head_sync.js
toolkit/components/places/tests/sync/test_bookmark_corruption.js
toolkit/components/places/tests/sync/test_bookmark_deduping.js
toolkit/components/places/tests/sync/test_bookmark_deletion.js
toolkit/components/places/tests/sync/test_bookmark_explicit_weakupload.js
toolkit/components/places/tests/sync/test_bookmark_haschanges.js
toolkit/components/places/tests/sync/test_bookmark_kinds.js
toolkit/components/places/tests/sync/test_bookmark_mirror_meta.js
toolkit/components/places/tests/sync/test_bookmark_structure_changes.js
toolkit/components/places/tests/sync/test_bookmark_validation.js
toolkit/components/places/tests/sync/test_bookmark_value_changes.js
--- a/services/sync/tests/unit/test_bookmark_engine.js
+++ b/services/sync/tests/unit/test_bookmark_engine.js
@@ -425,16 +425,17 @@ function doCheckWBOs(WBOs, expected) {
 
 function FakeRecord(constructor, r) {
   constructor.call(this, "bookmarks", r.id);
   for (let x in r) {
     this[x] = r[x];
   }
   // Borrow the constructor's conversion functions.
   this.toSyncBookmark = constructor.prototype.toSyncBookmark;
+  this.cleartextToString = constructor.prototype.cleartextToString;
 }
 
 // Bug 632287.
 add_task(async function test_mismatched_types() {
   _("Ensure that handling a record that changes type causes deletion " +
     "then re-adding.");
 
   let oldRecord = {
--- a/toolkit/components/places/SyncedBookmarksMirror.jsm
+++ b/toolkit/components/places/SyncedBookmarksMirror.jsm
@@ -319,45 +319,40 @@ class SyncedBookmarksMirror {
       tombstone: { id: 0, root: 0 },
     };
     let extraTelemetryEvents = [];
     try {
       await this.db.executeBeforeShutdown(
         "SyncedBookmarksMirror: store",
         db => db.executeTransaction(async () => {
           for await (let record of yieldingIterator(records)) {
+            MirrorLog.trace(`Storing in mirror: ${record.cleartextToString()}`);
             switch (record.type) {
               case "bookmark":
-                MirrorLog.trace("Storing bookmark in mirror", record);
                 await this.storeRemoteBookmark(record, ignoreCounts, options);
                 continue;
 
               case "query":
-                MirrorLog.trace("Storing query in mirror", record);
                 await this.storeRemoteQuery(record, ignoreCounts, options);
                 continue;
 
               case "folder":
-                MirrorLog.trace("Storing folder in mirror", record);
                 await this.storeRemoteFolder(record, ignoreCounts, options);
                 continue;
 
               case "livemark":
-                MirrorLog.trace("Storing livemark in mirror", record);
                 await this.storeRemoteLivemark(record, ignoreCounts, options);
                 continue;
 
               case "separator":
-                MirrorLog.trace("Storing separator in mirror", record);
                 await this.storeRemoteSeparator(record, ignoreCounts, options);
                 continue;
 
               default:
                 if (record.deleted) {
-                  MirrorLog.trace("Storing tombstone in mirror", record);
                   await this.storeRemoteTombstone(record, ignoreCounts,
                                                   options);
                   continue;
                 }
             }
             MirrorLog.warn("Ignoring record with unknown type", record.type);
             extraTelemetryEvents.push({
               method: "ignore",
--- a/toolkit/components/places/tests/sync/head_sync.js
+++ b/toolkit/components/places/tests/sync/head_sync.js
@@ -40,16 +40,50 @@ function run_test() {
   for (let log of [bufLog, sqliteLog]) {
     log.addAppender(appender);
   }
 
   do_get_profile();
   run_next_test();
 }
 
+// Returns a `CryptoWrapper`-like object that wraps the Sync record cleartext.
+// This exists to avoid importing `record.js` from Sync.
+function makeRecord(cleartext) {
+  return new Proxy({ cleartext }, {
+    get(target, property, receiver) {
+      if (property == "cleartext") {
+        return target.cleartext;
+      }
+      if (property == "cleartextToString") {
+        return () => JSON.stringify(target.cleartext);
+      }
+      return target.cleartext[property];
+    },
+    set(target, property, value, receiver) {
+      if (property == "cleartext") {
+        target.cleartext = value;
+      } else if (property != "cleartextToString") {
+        target.cleartext[property] = value;
+      }
+    },
+    has(target, property) {
+      return property == "cleartext" || (property in target.cleartext);
+    },
+    deleteProperty(target, property) {},
+    ownKeys(target) {
+      return ["cleartext", ...Reflect.ownKeys(target)];
+    },
+  });
+}
+
+async function storeRecords(buf, records, options) {
+  await buf.store(records.map(makeRecord), options);
+}
+
 function inspectChangeRecords(changeRecords) {
   let results = { updated: [], deleted: [] };
   for (let [id, record] of Object.entries(changeRecords)) {
     (record.tombstone ? results.deleted : results.updated).push(id);
   }
   results.updated.sort();
   results.deleted.sort();
   return results;
--- a/toolkit/components/places/tests/sync/test_bookmark_corruption.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_corruption.js
@@ -10,17 +10,17 @@ async function getCountOfBookmarkRows(db
 add_task(async function test_missing_children() {
   let buf = await openMirror("missing_childen");
 
   info("Set up empty mirror");
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make remote changes: A > ([B] C [D E])");
   {
-    await buf.store(shuffle([{
+    await storeRecords(buf, shuffle([{
       id: "menu",
       type: "folder",
       children: ["bookmarkBBBB", "bookmarkCCCC", "bookmarkDDDD",
                  "bookmarkEEEE"],
     }, {
       id: "bookmarkCCCC",
       type: "bookmark",
       bmkUri: "http://example.com/c",
@@ -49,17 +49,17 @@ add_task(async function test_missing_chi
     }, "Menu children should be (C)");
     let { missingChildren } = await buf.fetchRemoteOrphans();
     deepEqual(missingChildren.sort(), ["bookmarkBBBB", "bookmarkDDDD",
       "bookmarkEEEE"], "Should report (B D E) as missing");
   }
 
   info("Add (B E) to remote");
   {
-    await buf.store(shuffle([{
+    await storeRecords(buf, shuffle([{
       id: "bookmarkBBBB",
       type: "bookmark",
       title: "B",
       bmkUri: "http://example.com/b",
     }, {
       id: "bookmarkEEEE",
       type: "bookmark",
       title: "E",
@@ -100,17 +100,17 @@ add_task(async function test_missing_chi
     }, "Menu children should be (B C E)");
     let { missingChildren } = await buf.fetchRemoteOrphans();
     deepEqual(missingChildren, ["bookmarkDDDD"],
       "Should report (D) as missing");
   }
 
   info("Add D to remote");
   {
-    await buf.store([{
+    await storeRecords(buf, [{
       id: "bookmarkDDDD",
       type: "bookmark",
       title: "D",
       bmkUri: "http://example.com/d",
     }]);
     let changesToUpload = await buf.apply();
     deepEqual(await buf.fetchUnmergedGuids(), [], "Should merge all items");
 
@@ -164,17 +164,17 @@ add_task(async function test_new_orphan_
 
   info("Set up empty mirror");
   await PlacesTestUtils.markBookmarksAsSynced();
 
   // A doesn't exist locally, so we move the bookmarks into "unfiled" without
   // reuploading. When the partial uploader returns and uploads A, we'll
   // move the bookmarks to the correct folder.
   info("Make remote changes: [A] > (B C D)");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "bookmarkBBBB",
     type: "bookmark",
     title: "B (remote)",
     bmkUri: "http://example.com/b-remote",
   }, {
     id: "bookmarkCCCC",
     type: "bookmark",
     title: "C (remote)",
@@ -221,17 +221,17 @@ add_task(async function test_new_orphan_
       title: "D (remote)",
       url: "http://example.com/d-remote",
     }],
   }, "Should move (B C D) to unfiled");
 
   // A is an orphan because we don't have E locally, but we should move
   // (B C D) into A.
   info("Add [E] > A to remote");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkDDDD", "bookmarkCCCC", "bookmarkBBBB"],
   }]);
 
   info("Apply remote with A");
   {
@@ -272,17 +272,17 @@ add_task(async function test_new_orphan_
         index: 2,
         title: "B (remote)",
         url: "http://example.com/b-remote",
       }],
     }],
   }, "Should move (D C B) into A");
 
   info("Add E to remote");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "folderEEEEEE",
     type: "folder",
     title: "E",
     children: ["folderAAAAAA"],
   }]);
 
   info("Apply remote with E");
   {
@@ -330,17 +330,17 @@ add_task(async function test_new_orphan_
           title: "B (remote)",
           url: "http://example.com/b-remote",
         }],
       }],
     }],
   }, "Should move A into E");
 
   info("Add Menu > E to remote");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["folderEEEEEE"],
   }]);
 
   info("Apply remote with menu");
   {
     let changesToUpload = await buf.apply();
@@ -445,17 +445,17 @@ add_task(async function test_move_into_o
         children: [{
           guid: "bookmarkFFFF",
           title: "F",
           url: "http://example.com/f",
         }],
       }],
     }],
   });
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkBBBB", "folderCCCCCC"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
@@ -493,17 +493,17 @@ add_task(async function test_move_into_o
     guid: "bookmarkIIII",
     parentGuid: "folderEEEEEE",
     title: "I (local)",
     url: "http://example.com/i",
   });
 
   // G doesn't exist on the server.
   info("Make remote changes: ([G] > A (C > (D H E))), (C > H)");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
   }, {
     id: "folderCCCCCC",
     type: "folder",
     title: "C",
@@ -622,17 +622,17 @@ add_task(async function test_new_orphan_
         title: "B",
       }, {
         guid: "bookmarkEEEE",
         url: "http://example.com/e",
         title: "E",
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkBBBB", "bookmarkEEEE"],
@@ -648,17 +648,17 @@ add_task(async function test_new_orphan_
     bmkUri: "http://example.com/e",
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   // Simulate a partial write by another device that uploaded only B and C. A
   // exists locally, so we can move B and C into the correct folder, but not
   // the correct positions.
   info("Set up remote with orphans: [A] > (C D)");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "bookmarkDDDD",
     type: "bookmark",
     title: "D (remote)",
     bmkUri: "http://example.com/d-remote",
   }, {
     id: "bookmarkCCCC",
     type: "bookmark",
     title: "C (remote)",
@@ -733,17 +733,17 @@ add_task(async function test_new_orphan_
       type: PlacesUtils.bookmarks.TYPE_FOLDER,
       index: 4,
       title: MobileBookmarksTitle,
     }],
   }, "Should move (C D) to unfiled");
 
   // The partial uploader returns and uploads A.
   info("Add A to remote");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkCCCC", "bookmarkDDDD", "bookmarkEEEE", "bookmarkBBBB"],
   }]);
 
   info("Apply remote with A");
   {
@@ -794,17 +794,17 @@ add_task(async function test_new_orphan_
 });
 
 add_task(async function test_tombstone_as_child() {
   await PlacesTestUtils.markBookmarksAsSynced();
 
   let buf = await openMirror("tombstone_as_child");
   // Setup the mirror such that an incoming folder references a tombstone
   // as a child.
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkAAAA", "bookmarkTTTT", "bookmarkBBBB"],
@@ -896,17 +896,17 @@ add_task(async function test_left_pane_r
   // just checking the result of fetchLocalTree wouldn't pick that up - so
   // as an additional safety check, count how many bookmark rows exist.
   let numRows = await getCountOfBookmarkRows(buf.db);
 
   // Add a left pane root, a left-pane query and a left-pane folder to the
   // mirror, all correctly parented.
   // Because we can determine this is a complete tree that's outside our
   // syncable trees, we expect none of them to be applied.
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "folderLEFTPR",
     type: "folder",
     parentid: "places",
     title: "",
     children: ["folderLEFTPQ", "folderLEFTPF"],
   }, {
     id: "folderLEFTPQ",
     type: "query",
@@ -952,17 +952,17 @@ add_task(async function test_left_pane_q
   // happen to create a new item that's not under our syncable roots, then
   // just checking the result of fetchLocalTree wouldn't pick that up - so
   // as an additional safety check, count how many bookmark rows exist.
   let numRows = await getCountOfBookmarkRows(buf.db);
 
   // Add the left pane root and left-pane folders to the mirror, correctly parented.
   // We should not apply it because we made a policy decision to not apply
   // orphaned queries (bug 1433182)
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "folderLEFTPQ",
     type: "query",
     parentid: "folderLEFTPR",
     title: "Some query",
     bmkUri: "place:folder=SOMETHING",
   }], { needsMerge: true });
 
   await buf.apply();
@@ -995,17 +995,17 @@ add_task(async function test_partial_cyc
         children: [{
           guid: "bookmarkCCCC",
           url: "http://example.com/c",
           title: "C",
         }],
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["folderBBBBBB"],
@@ -1021,17 +1021,17 @@ add_task(async function test_partial_cyc
     bmkUri: "http://example.com/c",
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   // Try to create a cycle: move A into B, and B into the menu, but don't upload
   // a record for the menu. B is still a child of A locally. Since we ignore the
   // `parentid`, we'll move (B A) into unfiled.
   info("Make remote changes: A > C");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "folderAAAAAA",
     type: "folder",
     title: "A (remote)",
     children: ["bookmarkCCCC"],
   }, {
     id: "folderBBBBBB",
     type: "folder",
     title: "B (remote)",
@@ -1104,17 +1104,17 @@ add_task(async function test_complete_cy
   info("Set up empty mirror");
   await PlacesTestUtils.markBookmarksAsSynced();
 
   // This test is order-dependent. We shouldn't recurse infinitely, but,
   // depending on the order of the records, we might ignore the circular
   // subtree because there's nothing linking it back to the rest of the
   // tree.
   info("Make remote changes: Menu > A > B > C > A");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["folderBBBBBB"],
--- a/toolkit/components/places/tests/sync/test_bookmark_deduping.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_deduping.js
@@ -9,17 +9,17 @@ add_task(async function test_duping_loca
       if (method == "merge") {
         mergeTelemetryEvents.push({ value, extra });
       }
     },
   });
   let localModified = new Date();
 
   info("Start with empty local and mirror with merged items");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAA5"],
   }, {
     id: "bookmarkAAA5",
     type: "bookmark",
     bmkUri: "http://example.com/a",
     title: "A",
@@ -54,17 +54,17 @@ add_task(async function test_duping_loca
       title: "A",
       url: "http://example.com/a",
       dateAdded: localModified,
       lastModified: localModified,
     }],
   });
 
   info("Add older remote dupes");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkAAA4", "bookmarkAAA5"],
     modified: localModified / 1000 - 5,
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     bmkUri: "http://example.com/a",
@@ -215,17 +215,17 @@ add_task(async function test_duping_remo
       children: [{
         // Shouldn't dupe to `bookmarkG111`.
         guid: "bookmarkGGGG",
         url: "http://example.com/g",
         title: "G",
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkGGGG"],
@@ -300,17 +300,17 @@ add_task(async function test_duping_remo
     guid: "bookmarkHHHH",
     url: "http://example.com/h",
     title: "H",
     dateAdded: localModified,
     lastModified: localModified,
   });
 
   info("Make remote changes");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA", "folderB11111", "folderA11111",
                "separatorE11", "queryD111111"],
     dateAdded: localModified.getTime(),
     modified: localModified / 1000 + 5,
   }, {
     id: "folderB11111",
@@ -550,17 +550,17 @@ add_task(async function test_duping_both
         url: "http://example.com/g",
         dateAdded: new Date(now - 10000),
         lastModified: new Date(now - 5000),
       }],
     }],
   });
 
   info("Add remote dupes");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA", "folderDDDDDD", "folderFFFFFF"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     dateAdded: now - 10000,
@@ -743,17 +743,17 @@ add_task(async function test_duping_both
 
 add_task(async function test_applying_two_empty_folders_doesnt_smush() {
   let buf = await openMirror("applying_two_empty_folders_doesnt_smush");
 
   info("Set up empty mirror");
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make remote changes");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "mobile",
     type: "folder",
     children: ["emptyempty01", "emptyempty02"],
   }, {
     id: "emptyempty01",
     type: "folder",
     title: "Empty",
   }, {
@@ -811,17 +811,17 @@ add_task(async function test_applying_tw
     }, {
       guid: "emptyemptyL0",
       type: PlacesUtils.bookmarks.TYPE_FOLDER,
       title: "Empty",
     }],
   });
 
   info("Make remote changes");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "mobile",
     type: "folder",
     children: ["emptyempty01", "emptyempty02", "emptyempty03"],
   }, {
     id: "emptyempty01",
     type: "folder",
     title: "Empty",
   }, {
@@ -889,17 +889,17 @@ add_task(async function test_duping_mobi
   await PlacesUtils.bookmarks.insert({
     guid: "bookmarkAAA1",
     parentGuid: PlacesUtils.bookmarks.mobileGuid,
     title: "A",
     url: "http://example.com/a",
   });
 
   info("Make remote changes");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "mobile",
     type: "folder",
     children: ["bookmarkAAAA"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
--- a/toolkit/components/places/tests/sync/test_bookmark_deletion.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_deletion.js
@@ -23,17 +23,17 @@ add_task(async function test_complex_orp
       title: "A",
       children: [{
         guid: "folderBBBBBB",
         type: PlacesUtils.bookmarks.TYPE_FOLDER,
         title: "B",
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "toolbar",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["folderBBBBBB"],
@@ -55,17 +55,17 @@ add_task(async function test_complex_orp
         children: [{
           guid: "folderDDDDDD",
           type: PlacesUtils.bookmarks.TYPE_FOLDER,
           title: "D",
         }],
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderGGGGGG"],
   }, {
     id: "folderGGGGGG",
     type: "folder",
     title: "G",
     children: ["folderCCCCCC"],
@@ -86,17 +86,17 @@ add_task(async function test_complex_orp
   await PlacesUtils.bookmarks.insert({
     guid: "bookmarkEEEE",
     parentGuid: "folderBBBBBB",
     title: "E",
     url: "http://example.com/e",
   });
 
   info("Make remote changes: delete B, add D > F");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "folderBBBBBB",
     deleted: true,
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
   }, {
     id: "folderDDDDDD",
@@ -223,17 +223,17 @@ add_task(async function test_locally_mod
         children: [{
           guid: "bookmarkEEEE",
           title: "E",
           url: "http://example.com/e",
         }],
       }],
     }],
   });
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "folderBBBBBB"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
@@ -275,17 +275,17 @@ add_task(async function test_locally_mod
   await PlacesUtils.bookmarks.insert({
     guid: "bookmarkGGGG",
     parentGuid: "folderBBBBBB",
     title: "G (local)",
     url: "http://example.com/g-local",
   });
 
   info("Make remote changes: delete A, B");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: [],
   }, {
     id: "bookmarkAAAA",
     deleted: true,
   }, {
     id: "folderBBBBBB",
@@ -379,17 +379,17 @@ add_task(async function test_locally_del
         children: [{
           guid: "bookmarkEEEE",
           title: "E",
           url: "http://example.com/e",
         }],
       }],
     }],
   });
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "folderBBBBBB"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
@@ -416,17 +416,17 @@ add_task(async function test_locally_del
   }], { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make local changes: delete A, B");
   await PlacesUtils.bookmarks.remove("bookmarkAAAA");
   await PlacesUtils.bookmarks.remove("folderBBBBBB");
 
   info("Make remote changes: change A; B > ((D > F) G)");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A (remote)",
     bmkUri: "http://example.com/a-remote",
   }, {
     id: "folderBBBBBB",
     type: "folder",
     title: "B (remote)",
@@ -514,17 +514,17 @@ add_task(async function test_move_to_new
         }, {
           guid: "bookmarkDDDD",
           url: "http://example.com/d",
           title: "D",
         }],
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["folderBBBBBB"],
@@ -557,17 +557,17 @@ add_task(async function test_move_to_new
     guid: "folderAAAAAA",
     parentGuid: "folderEEEEEE",
     index: PlacesUtils.bookmarks.DEFAULT_INDEX,
   });
   // E isn't synced, so we shouldn't upload a tombstone.
   await PlacesUtils.bookmarks.remove("folderEEEEEE");
 
   info("Make remote changes");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "bookmarkCCCC",
     type: "bookmark",
     title: "C (remote)",
     bmkUri: "http://example.com/c-remote",
   }]);
 
   info("Apply remote");
   let changesToUpload = await buf.apply();
@@ -636,17 +636,17 @@ add_task(async function test_nonexistent
     // we remove it.
     source: PlacesUtils.bookmarks.SOURCES.RESTORE,
   });
   await PlacesUtils.bookmarks.remove("bookmarkAAAA");
 
   // B doesn't exist in Places, and we don't currently persist tombstones (bug
   // 1343103), so we should ignore it.
   info("Create remote tombstone for nonexistent local item B");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "bookmarkBBBB",
     deleted: true
   }]);
 
   info("Apply remote");
   let changesToUpload = await buf.apply();
   deepEqual(await buf.fetchUnmergedGuids(), ["bookmarkBBBB"],
     "Should leave B unmerged");
@@ -708,17 +708,17 @@ add_task(async function test_clear_folde
         title: "E",
       }, {
         guid: "bookmarkFFFF",
         url: "http://example.com/f",
         title: "F",
       }],
     }],
   });
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA", "bookmarkDDDD"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkBBBB", "bookmarkCCCC"],
@@ -759,17 +759,17 @@ add_task(async function test_clear_folde
   await PlacesUtils.bookmarks.update({
     guid: "bookmarkFFFF",
     parentGuid: PlacesUtils.bookmarks.mobileGuid,
     index: 0,
   });
   await PlacesUtils.bookmarks.remove("bookmarkDDDD");
 
   info("Make remote changes: Menu > D, Unfiled > C, delete A");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkBBBB", "bookmarkDDDD"],
   }, {
     id: "unfiled",
     type: "folder",
     children: ["bookmarkCCCC"],
   }, {
@@ -868,17 +868,17 @@ add_task(async function test_newer_move_
       title: "C",
       children: [{
         guid: "bookmarkDDDD",
         url: "http://example.com/d",
         title: "D",
       }],
     }],
   });
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA", "folderCCCCCC"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkBBBB"],
@@ -921,17 +921,17 @@ add_task(async function test_newer_move_
     lastModified: new Date(now),
   });
   await PlacesUtils.bookmarks.remove("folderCCCCCC");
 
   // C will have a newer remote timestamp. However, we should *not* revert
   // locally moving D to the toolbar. (Locally, D exists in C, but we
   // deleted the now-empty C locally).
   info("Make remote changes: C > F, Toolbar > B, delete A");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "folderCCCCCC",
     type: "folder",
     title: "C",
     children: ["bookmarkDDDD", "bookmarkFFFF"],
     modified: (now / 1000) + 5,
   }, {
     id: "bookmarkFFFF",
     type: "bookmark",
--- a/toolkit/components/places/tests/sync/test_bookmark_explicit_weakupload.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_explicit_weakupload.js
@@ -8,17 +8,17 @@ add_task(async function test_explicit_we
     guid: PlacesUtils.bookmarks.menuGuid,
     children: [{
       guid: "mozBmk______",
       url: "https://mozilla.org",
       title: "Mozilla",
       tags: ["moz", "dot", "org"],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["mozBmk______"],
   }, {
     id: "mozBmk______",
     type: "bookmark",
     title: "Mozilla",
     bmkUri: "https://mozilla.org",
@@ -47,31 +47,31 @@ add_task(async function test_explicit_we
     guid: PlacesUtils.bookmarks.menuGuid,
     children: [{
       guid: "mozBmk______",
       url: "https://mozilla.org",
       title: "Mozilla",
       dateAdded,
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["mozBmk______"],
   }, {
     id: "mozBmk______",
     type: "bookmark",
     title: "Mozilla",
     bmkUri: "https://mozilla.org",
     dateAdded: dateAdded.getTime(),
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make remote change with older date added");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "mozBmk______",
     type: "bookmark",
     title: "Firefox",
     bmkUri: "http://getfirefox.com/",
     dateAdded: dateAdded.getTime() + 5000,
   }]);
 
   info("Explicitly request changed item for weak upload");
--- a/toolkit/components/places/tests/sync/test_bookmark_haschanges.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_haschanges.js
@@ -8,17 +8,17 @@ add_task(async function test_no_changes(
     guid: PlacesUtils.bookmarks.menuGuid,
     children: [{
       guid: "mozBmk______",
       url: "https://mozilla.org",
       title: "Mozilla",
       tags: ["moz", "dot", "org"],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["mozBmk______"],
   }, {
     id: "toolbar",
     type: "folder",
     children: [],
   }, {
@@ -53,30 +53,30 @@ add_task(async function test_changes_rem
     guid: PlacesUtils.bookmarks.menuGuid,
     children: [{
       guid: "mozBmk______",
       url: "https://mozilla.org",
       title: "Mozilla",
       tags: ["moz", "dot", "org"],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["mozBmk______"],
   }, {
     id: "mozBmk______",
     type: "bookmark",
     title: "Mozilla",
     bmkUri: "https://mozilla.org",
     tags: ["moz", "dot", "org"],
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "mozBmk______",
     type: "bookmark",
     title: "New Mozilla",
     bmkUri: "https://mozilla.org",
     tags: ["moz", "dot", "org"]
   }], { needsMerge: true });
 
   const hasChanges = await buf.hasChanges();
@@ -94,17 +94,17 @@ add_task(async function test_changes_loc
     guid: PlacesUtils.bookmarks.menuGuid,
     children: [{
       guid: "mozBmk______",
       url: "https://mozilla.org",
       title: "Mozilla",
       tags: ["moz", "dot", "org"],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["mozBmk______"],
   }, {
     id: "mozBmk______",
     type: "bookmark",
     title: "Mozilla",
     bmkUri: "https://mozilla.org",
@@ -132,17 +132,17 @@ add_task(async function test_changes_del
     guid: PlacesUtils.bookmarks.menuGuid,
     children: [{
       guid: "mozBmk______",
       url: "https://mozilla.org",
       title: "Mozilla",
       tags: ["moz", "dot", "org"],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["mozBmk______"],
   }, {
     id: "mozBmk______",
     type: "bookmark",
     title: "Mozilla",
     bmkUri: "https://mozilla.org",
--- a/toolkit/components/places/tests/sync/test_bookmark_kinds.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_kinds.js
@@ -15,17 +15,17 @@ add_task(async function test_livemarks()
         type: PlacesUtils.bookmarks.TYPE_FOLDER,
         title: "A",
         annos: [{
           name: PlacesUtils.LMANNO_FEEDURI,
           value: site + "/feed/a",
         }],
       }],
     });
-    await buf.store(shuffle([{
+    await storeRecords(buf, shuffle([{
       id: "menu",
       type: "folder",
       children: ["livemarkAAAA"],
     }, {
       id: "livemarkAAAA",
       type: "livemark",
       title: "A",
       feedUri: site + "/feed/a",
@@ -44,17 +44,17 @@ add_task(async function test_livemarks()
       parentGuid: PlacesUtils.bookmarks.menuGuid,
       guid: "livemarkDDDD",
       title: "D",
       feedURI: Services.io.newURI(site + "/feed/d"),
       siteURI: Services.io.newURI(site + "/site/d"),
     });
 
     info("Make remote changes");
-    await buf.store(shuffle([{
+    await storeRecords(buf, shuffle([{
       id: "livemarkAAAA",
       type: "livemark",
       title: "A (remote)",
       feedUri: site + "/feed/a-remote",
     }, {
       id: "toolbar",
       type: "folder",
       children: ["livemarkCCCC", "livemarkB111"],
@@ -329,17 +329,17 @@ add_task(async function test_mismatched_
       guid: "l1nZZXfB8nC7",
       type: PlacesUtils.bookmarks.TYPE_FOLDER,
       title: "Innerst i Sneglehode",
     }],
   });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make remote changes");
-  await buf.store([{
+  await storeRecords(buf, [{
     "id": "l1nZZXfB8nC7",
     "type": "livemark",
     "siteUri": "http://sneglehode.wordpress.com/",
     "feedUri": "http://sneglehode.wordpress.com/feed/",
     "parentName": "Bookmarks Toolbar",
     "title": "Innerst i Sneglehode",
     "description": null,
     "children":
@@ -390,17 +390,17 @@ add_task(async function test_mismatched_
           name: PlacesUtils.LMANNO_FEEDURI,
           value: "http://example.com/feed/a",
         }],
       }],
     });
     await PlacesTestUtils.markBookmarksAsSynced();
 
     info("Make remote changes");
-    await buf.store([{
+    await storeRecords(buf, [{
       "id": "livemarkAAAA",
       "type": "folder",
       "title": "not really a Livemark",
       "description": null,
       "parentid": "menu"
     }]);
 
     info("Apply remote, should fail");
@@ -438,17 +438,17 @@ add_task(async function test_different_b
 
     let changes = await buf.apply();
     // We should have an outgoing record for bookmarkA with type=bookmark
     // and bookmarkB with type=query.
     Assert.equal(changes.bookmarkAAAA.cleartext.type, "bookmark");
     Assert.equal(changes.bookmarkBBBB.cleartext.type, "query");
 
     // Now pretend that same records are already on the server.
-    await buf.store([{
+    await storeRecords(buf, [{
       id: "menu",
       type: "folder",
       children: ["bookmarkAAAA", "bookmarkBBBB"],
     }, {
       id: "bookmarkAAAA",
       parentid: "menu",
       type: "bookmark",
       title: "not yet a query",
@@ -511,17 +511,17 @@ add_task(async function test_incompatibl
         },
       ],
     });
 
     await buf.apply();
 
     // Now pretend that same records are already on the server with incompatible
     // types.
-    await buf.store([{
+    await storeRecords(buf, [{
       id: "menu",
       type: "folder",
       children: ["AAAAAAAAAAAA"],
     }, {
       id: "AAAAAAAAAAAA",
       parentId: PlacesSyncUtils.bookmarks.guidToRecordId(PlacesUtils.bookmarks.menuGuid),
       type: "folder",
       title: "conflicting folder",
--- a/toolkit/components/places/tests/sync/test_bookmark_mirror_meta.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_mirror_meta.js
@@ -6,31 +6,31 @@ add_task(async function test_highWaterMa
 
   strictEqual(await buf.getCollectionHighWaterMark(), 0,
     "High water mark should be 0 without items");
 
   await buf.setCollectionLastModified(123.45);
   equal(await buf.getCollectionHighWaterMark(), 123.45,
     "High water mark should be last modified time without items");
 
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: [],
     modified: 50,
   }, {
     id: "toolbar",
     type: "folder",
     children: [],
     modified: 123.95,
   }]);
   equal(await buf.getCollectionHighWaterMark(), 123.45,
     "High water mark should be last modified time if items are older");
 
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "unfiled",
     type: "folder",
     children: [],
     modified: 125.45,
   }]);
   equal(await buf.getCollectionHighWaterMark(), 124.45,
     "High water mark should be modified time - 1s of newest record if exists");
 
@@ -40,17 +40,17 @@ add_task(async function test_highWaterMa
 add_task(async function test_ensureCurrentSyncId() {
   let buf = await openMirror("ensureCurrentSyncId");
 
   await buf.ensureCurrentSyncId("syncIdAAAAAA");
   equal(await buf.getCollectionHighWaterMark(), 0,
     "High water mark should be 0 after setting sync ID");
 
   info("Insert items and set collection last modified");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
     modified: 125.45,
   }, {
     id: "folderAAAAAA",
     type: "folder",
     children: [],
--- a/toolkit/components/places/tests/sync/test_bookmark_structure_changes.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_structure_changes.js
@@ -26,17 +26,17 @@ add_task(async function test_value_struc
       title: "D",
       children: [{
         guid: "bookmarkEEEE",
         url: "http://example.com/e",
         title: "E",
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA", "folderDDDDDD"],
     modified: Date.now() / 1000 - 60,
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
@@ -78,17 +78,17 @@ add_task(async function test_value_struc
   info("Make local structure change");
   await PlacesUtils.bookmarks.update({
     guid: "bookmarkBBBB",
     parentGuid: "folderDDDDDD",
     index: 0,
   });
 
   info("Make remote value change");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "folderDDDDDD",
     type: "folder",
     title: "D (remote)",
     children: ["bookmarkEEEE"],
     modified: Date.now() / 1000 + 60,
   }]);
 
   info("Apply remote");
@@ -213,17 +213,17 @@ add_task(async function test_move() {
     }, {
       guid: "bzBmk_______",
       title: "Bugzilla",
       url: "https://bugzilla.mozilla.org",
     }]
   });
   await PlacesTestUtils.markBookmarksAsSynced();
 
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "unfiled",
     type: "folder",
     children: ["mozFolder___"],
   }, {
     id: "toolbar",
     type: "folder",
     children: ["devFolder___"],
   }, {
@@ -444,17 +444,17 @@ add_task(async function test_move_into_p
       title: "A",
       children: [{
         guid: "bookmarkBBBB",
         url: "http://example.com/b",
         title: "B",
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkBBBB"],
@@ -462,17 +462,17 @@ add_task(async function test_move_into_p
     id: "bookmarkBBBB",
     type: "bookmark",
     title: "B",
     bmkUri: "http://example.com/b",
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make remote changes: Menu > (A (B > C))");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA", "folderCCCCCC"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
   }, {
@@ -570,17 +570,17 @@ add_task(async function test_complex_mov
         title: "B",
       }, {
         guid: "bookmarkCCCC",
         url: "http://example.com/c",
         title: "C",
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkBBBB", "bookmarkCCCC"],
@@ -601,17 +601,17 @@ add_task(async function test_complex_mov
   await PlacesUtils.bookmarks.insert({
     guid: "bookmarkDDDD",
     parentGuid: "folderAAAAAA",
     title: "D (local)",
     url: "http://example.com/d-local",
   });
 
   info("Make remote change: ((Menu > C) (Toolbar > A > (B E)))");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["bookmarkCCCC"],
   }, {
     id: "toolbar",
     type: "folder",
     children: ["folderAAAAAA"],
   }, {
@@ -779,17 +779,17 @@ add_task(async function test_reorder_and
       url: "http://example.com/e",
       title: "E",
     }, {
       guid: "bookmarkFFFF",
       url: "http://example.com/f",
       title: "F",
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkBBBB", "bookmarkCCCC"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
@@ -843,17 +843,17 @@ add_task(async function test_reorder_and
       url: "http://example.com/h",
       title: "H",
       dateAdded: new Date(now),
       lastModified: new Date(now),
     }],
   });
 
   info("Make remote changes: Reorder Toolbar, Menu > (I J)");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     // The server has a newer toolbar, so we should use the remote order (F D E)
     // as the base, then append (G H).
     id: "toolbar",
     type: "folder",
     children: ["bookmarkFFFF", "bookmarkDDDD", "bookmarkEEEE"],
     modified: now / 1000 + 5,
   }, {
     // The server has an older menu, so we should use the local order (C A B)
--- a/toolkit/components/places/tests/sync/test_bookmark_validation.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_validation.js
@@ -50,17 +50,17 @@ add_task(async function test_inconsisten
 
   deepEqual(await buf.fetchInconsistencies(), {
     missingLocal: [],
     missingRemote: [],
     wrongSyncStatus: [],
   }, "Should not report inconsistencies with empty mirror");
 
   info("Set up mirror");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkDDDD"],
   }, {
     id: "toolbar",
     type: "folder",
     children: ["bookmarkFFFF"],
   }, {
@@ -80,17 +80,17 @@ add_task(async function test_inconsisten
     bmkUri: "http://example.com/f",
   }, {
     // Merged bookmark that doesn't exist locally.
     id: "bookmarkGGGG",
     type: "bookmark",
     title: "G",
     bmkUri: "http://example.com/g",
   }], { needsMerge: false });
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "bookmarkHHHH",
     type: "bookmark",
     title: "H",
     bmkUri: "http://example.com/h",
   }, {
     id: "bookmarkIIII",
     deleted: true,
   }]);
--- a/toolkit/components/places/tests/sync/test_bookmark_value_changes.js
+++ b/toolkit/components/places/tests/sync/test_bookmark_value_changes.js
@@ -9,17 +9,17 @@ add_task(async function test_value_combo
     guid: PlacesUtils.bookmarks.menuGuid,
     children: [{
       guid: "mozBmk______",
       url: "https://mozilla.org",
       title: "Mozilla",
       tags: ["moz", "dot", "org"],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["mozBmk______"],
   }, {
     id: "mozBmk______",
     type: "bookmark",
     title: "Mozilla",
     bmkUri: "https://mozilla.org",
@@ -34,17 +34,17 @@ add_task(async function test_value_combo
       guid: "bzBmk_______",
       url: "https://bugzilla.mozilla.org",
       title: "Bugzilla",
       tags: ["new", "tag"],
     }],
   });
 
   info("Insert remote bookmarks and folder to apply");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "mozBmk______",
     type: "bookmark",
     title: "Mozilla home page",
     bmkUri: "https://mozilla.org",
     tags: ["browsers"],
   }, {
     id: "toolbar",
     type: "folder",
@@ -240,17 +240,17 @@ add_task(async function test_value_only_
         children: [{
           guid: "bookmarkIIII",
           url: "http://example.com/i",
           title: "I",
         }],
       }],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["folderAAAAAA", "folderFFFFFF"],
   }, {
     id: "folderAAAAAA",
     type: "folder",
     title: "A",
     children: ["bookmarkBBBB", "bookmarkCCCC", "folderJJJJJJ", "bookmarkDDDD",
@@ -304,17 +304,17 @@ add_task(async function test_value_only_
     id: "bookmarkIIII",
     type: "bookmark",
     title: "I",
     bmkUri: "http://example.com/i",
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make remote changes");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "bookmarkCCCC",
     type: "bookmark",
     title: "C (remote)",
     bmkUri: "http://example.com/c-remote",
   }, {
     id: "bookmarkEEEE",
     type: "bookmark",
     title: "E (remote)",
@@ -463,17 +463,17 @@ add_task(async function test_keywords() 
       url: "http://example.com/c",
     }, {
       guid: "bookmarkDDDD",
       title: "D",
       url: "http://example.com/d",
       keyword: "three",
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkBBBB", "bookmarkCCCC", "bookmarkDDDD"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
@@ -494,17 +494,17 @@ add_task(async function test_keywords() 
     type: "bookmark",
     title: "D",
     bmkUri: "http://example.com/d",
     keyword: "three",
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Change keywords remotely");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
     keyword: "two",
   }, {
     id: "bookmarkBBBB",
     type: "bookmark",
@@ -568,17 +568,17 @@ add_task(async function test_keywords_co
       url: "http://example.com/d",
     }, {
       guid: "bookmarkEEEE",
       title: "E",
       url: "http://example.com/e",
       keyword: "three",
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["bookmarkBBBB", "bookmarkCCCC", "bookmarkDDDD", "bookmarkEEEE"],
   }, {
     id: "bookmarkBBBB",
     type: "bookmark",
     title: "B",
     bmkUri: "http://example.com/b",
@@ -599,17 +599,17 @@ add_task(async function test_keywords_co
     type: "bookmark",
     title: "E",
     bmkUri: "http://example.com/e",
     keyword: "three",
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make remote changes");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkAAA1", "bookmarkBBBB", "bookmarkCCCC",
                "bookmarkDDDD", "bookmarkEEEE"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
@@ -806,17 +806,17 @@ add_task(async function test_tags() {
       url: "http://example.com/c",
     }, {
       guid: "bookmarkDDDD",
       title: "D",
       url: "http://example.com/d",
       tags: ["seven", "eight", "nine"],
     }],
   });
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkBBBB", "bookmarkCCCC", "bookmarkDDDD"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
@@ -837,17 +837,17 @@ add_task(async function test_tags() {
     type: "bookmark",
     title: "D",
     bmkUri: "http://example.com/d",
     tags: ["seven", "eight", "nine"],
   }]), { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Change tags remotely");
-  await buf.store(shuffle([{
+  await storeRecords(buf, shuffle([{
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
     tags: ["one", "two", "ten"],
   }, {
     id: "bookmarkBBBB",
     type: "bookmark",
@@ -902,17 +902,17 @@ add_task(async function test_rewrite_tag
       url: "http://example.com/a",
     }, {
       guid: "bookmarkDDDD",
       title: "D",
       url: "http://example.com/d",
       tags: ["kitty"],
     }],
   });
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkDDDD"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     bmkUri: "http://example.com/a",
@@ -921,17 +921,17 @@ add_task(async function test_rewrite_tag
     type: "bookmark",
     title: "D",
     bmkUri: "http://example.com/d",
     tags: ["kitty"],
   }], { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Add tag queries for new and existing tags");
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "toolbar",
     type: "folder",
     children: ["queryBBBBBBB", "queryCCCCCCC", "bookmarkEEEE"],
   }, {
     id: "queryBBBBBBB",
     type: "query",
     title: "Tagged stuff",
     bmkUri: "place:type=7&folder=999",
@@ -1010,17 +1010,17 @@ add_task(async function test_date_added(
       url: "http://example.com/a",
     }, {
       guid: "bookmarkBBBB",
       dateAdded: bDateAdded,
       title: "B",
       url: "http://example.com/b",
     }],
   });
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "menu",
     type: "folder",
     children: ["bookmarkAAAA", "bookmarkBBBB"],
   }, {
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A",
     dateAdded: aDateAdded.getTime(),
@@ -1031,17 +1031,17 @@ add_task(async function test_date_added(
     title: "B",
     dateAdded: bDateAdded.getTime(),
     bmkUri: "http://example.com/b",
   }], { needsMerge: false });
   await PlacesTestUtils.markBookmarksAsSynced();
 
   info("Make remote changes");
   let bNewDateAdded = new Date(bDateAdded.getTime() - 1 * 60 * 60 * 1000);
-  await buf.store([{
+  await storeRecords(buf, [{
     id: "bookmarkAAAA",
     type: "bookmark",
     title: "A (remote)",
     dateAdded: Date.now(),
     bmkUri: "http://example.com/a",
   }, {
     id: "bookmarkBBBB",
     type: "bookmark",