Bug 1481795 - Remove the maintenance task for reparenting built-in root folders r=Standard8
authorKajal Kumari Sah <kajalksah07@gmail.com>
Fri, 14 Sep 2018 10:41:32 +0000
changeset 436331 c22c89c9a6c2449c9f355815ee2b54a2c1c1d645
parent 436330 c05f1fdd8e4491c79999e34f6b3b4b1cf612ba0a
child 436332 4e733c98fca629be489f94aa77129c690b323633
push id34640
push usercbrindusan@mozilla.com
push dateFri, 14 Sep 2018 15:27:56 +0000
treeherdermozilla-central@619ef3811776 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1481795, 1472241
milestone64.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 1481795 - Remove the maintenance task for reparenting built-in root folders r=Standard8 This is now managed on initialisation (xref bug 1472241) Differential Revision: https://phabricator.services.mozilla.com/D5675
toolkit/components/places/PlacesDBUtils.jsm
toolkit/components/places/tests/maintenance/test_preventive_maintenance.js
--- a/toolkit/components/places/PlacesDBUtils.jsm
+++ b/toolkit/components/places/PlacesDBUtils.jsm
@@ -369,32 +369,16 @@ var PlacesDBUtils = {
       { query:
         `DELETE FROM moz_annos WHERE id IN (
           SELECT id FROM moz_annos a
           WHERE NOT EXISTS
             (SELECT id FROM moz_places WHERE id = a.place_id LIMIT 1)
         )`,
       },
 
-      // C.1 Fix built-in folders with incorrect parents.
-      { query:
-        `UPDATE moz_bookmarks SET parent = :rootId
-         WHERE guid IN (
-           :menuGuid, :toolbarGuid, :unfiledGuid, :tagsGuid, :mobileGuid
-         ) AND parent <> :rootId`,
-        params: {
-          rootId: PlacesUtils.placesRootId,
-          menuGuid: PlacesUtils.bookmarks.menuGuid,
-          toolbarGuid: PlacesUtils.bookmarks.toolbarGuid,
-          unfiledGuid: PlacesUtils.bookmarks.unfiledGuid,
-          tagsGuid: PlacesUtils.bookmarks.tagsGuid,
-          mobileGuid: PlacesUtils.bookmarks.mobileGuid,
-        },
-      },
-
       // D.1 remove items without a valid place
       // If fk IS NULL we fix them in D.7
       { query:
         `DELETE FROM moz_bookmarks WHERE guid NOT IN (
           :rootGuid, :menuGuid, :toolbarGuid, :unfiledGuid, :tagsGuid  /* skip roots */
         ) AND id IN (
           SELECT b.id FROM moz_bookmarks b
           WHERE fk NOT NULL AND b.type = :bookmark_type
--- a/toolkit/components/places/tests/maintenance/test_preventive_maintenance.js
+++ b/toolkit/components/places/tests/maintenance/test_preventive_maintenance.js
@@ -346,49 +346,16 @@ tests.push({
     Assert.ok(!stmt.executeStep());
     stmt.finalize();
   },
 });
 
 // ------------------------------------------------------------------------------
 
 tests.push({
-  name: "C.1",
-  desc: "fix invalid parents for Places folders",
-
-  setup() {
-    // Reparent the roots to something invalid.
-    mDBConn.executeSimpleSQL(`
-      UPDATE moz_bookmarks SET parent = 2
-      WHERE parent = (SELECT id from moz_bookmarks WHERE guid = "${PlacesUtils.bookmarks.rootGuid}")
-    `);
-  },
-
-  async check() {
-    let db = await PlacesUtils.promiseDBConnection();
-
-    let rows = await db.executeCached(`
-      SELECT guid FROM moz_bookmarks
-      WHERE parent = (SELECT id from moz_bookmarks WHERE guid = "${PlacesUtils.bookmarks.rootGuid}")
-    `);
-
-    let guids = rows.map(row => row.getResultByName("guid"));
-    Assert.deepEqual(guids, [
-      PlacesUtils.bookmarks.menuGuid,
-      PlacesUtils.bookmarks.toolbarGuid,
-      PlacesUtils.bookmarks.tagsGuid,
-      PlacesUtils.bookmarks.unfiledGuid,
-      PlacesUtils.bookmarks.mobileGuid,
-    ]);
-  },
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
   name: "D.1",
   desc: "Remove items without a valid place",
 
   _validItemId: null,
   _invalidItemId: null,
   _invalidSyncedItemId: null,
   placeId: null,