Backed out changeset bf5c890bbac1 (bug 1408551) for xpcshell failures on test_bookmark_kinds.js. CLOSED TREE

This commit is contained in:
Csoregi Natalia 2018-02-27 02:06:31 +02:00
parent d5f0195299
commit 1ca9a26647
3 changed files with 6 additions and 76 deletions

View File

@ -736,19 +736,6 @@ BufferedBookmarksEngine.prototype = {
},
async _createRecord(id) {
let record = await this._doCreateRecord(id);
if (!record.deleted) {
// Set hasDupe on all (non-deleted) records since we don't use it (e.g.
// the buffered engine doesn't), and we want to minimize the risk of older
// clients corrupting records. Note that the SyncedBookmarksMirror sets it
// for all records that it created, but we would like to ensure that
// weakly uploaded records are marked as hasDupe as well.
record.hasDupe = true;
}
return record;
},
async _doCreateRecord(id) {
if (this._needWeakUpload.has(id)) {
return this._store.createRecord(id, this.name);
}

View File

@ -820,59 +820,6 @@ add_bookmark_test(async function test_sync_dateAdded(engine) {
}
});
add_task(async function test_buffer_hasDupe() {
await Service.recordManager.clearCache();
await PlacesSyncUtils.bookmarks.reset();
let engine = new BufferedBookmarksEngine(Service);
await engine.initialize();
let server = await serverForFoo(engine);
await SyncTestingInfrastructure(server);
let collection = server.user("foo").collection("bookmarks");
engine._tracker.start(); // We skip usual startup...
try {
let guid1 = Utils.makeGUID();
let guid2 = Utils.makeGUID();
await PlacesUtils.bookmarks.insert({
guid: guid1,
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
url: "https://www.example.com",
title: "example.com",
});
await PlacesUtils.bookmarks.insert({
guid: guid2,
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
url: "https://www.example.com",
title: "example.com",
});
await sync_engine_and_validate_telem(engine, false);
// Make sure we set hasDupe on outgoing records
Assert.ok(collection.payloads().every(payload => payload.hasDupe));
await PlacesUtils.bookmarks.remove(guid1);
// Make sure it works for weakly uploaded records
engine.addForWeakUpload(guid2);
await sync_engine_and_validate_telem(engine, false);
let tombstone = JSON.parse(JSON.parse(collection.payload(guid1)).ciphertext);
// We shouldn't set hasDupe on tombstones.
Assert.ok(tombstone.deleted);
Assert.ok(!tombstone.hasDupe);
let record = JSON.parse(JSON.parse(collection.payload(guid2)).ciphertext);
// We should set hasDupe on weakly uploaded records.
Assert.ok(!record.deleted);
Assert.ok(record.hasDupe,
"Buffered bookmark engine should set hasDupe for weakly uploaded records.");
await sync_engine_and_validate_telem(engine, false);
} finally {
await cleanup(engine, server);
}
});
// Bug 890217.
add_task(async function test_sync_imap_URLs() {
await Service.recordManager.clearCache();

View File

@ -1644,12 +1644,8 @@ class SyncedBookmarksMirror {
// iOS is stricter and requires both `children` and `parentid` to
// match.
parentid: parentRecordId,
// Older Desktops use `hasDupe` (along with `parentName` for
// deduping), if hasDupe is true, then they won't attempt deduping
// (since they believe that a duplicate for this record should
// exist). We set it to true to prevent them from applying their
// deduping logic.
hasDupe: true,
// Older Desktops use `hasDupe` and `parentName` for deduping.
hasDupe: false,
parentName: row.getResultByName("parentTitle"),
dateAdded,
bmkUri: row.getResultByName("url"),
@ -1670,7 +1666,7 @@ class SyncedBookmarksMirror {
id: recordId,
type: "bookmark",
parentid: parentRecordId,
hasDupe: true,
hasDupe: false,
parentName: row.getResultByName("parentTitle"),
dateAdded,
bmkUri: row.getResultByName("url"),
@ -1706,7 +1702,7 @@ class SyncedBookmarksMirror {
id: recordId,
type: "livemark",
parentid: parentRecordId,
hasDupe: true,
hasDupe: false,
parentName: row.getResultByName("parentTitle"),
dateAdded,
title: row.getResultByName("title"),
@ -1729,7 +1725,7 @@ class SyncedBookmarksMirror {
id: recordId,
type: "folder",
parentid: parentRecordId,
hasDupe: true,
hasDupe: false,
parentName: row.getResultByName("parentTitle"),
dateAdded,
title: row.getResultByName("title"),
@ -1757,7 +1753,7 @@ class SyncedBookmarksMirror {
id: recordId,
type: "separator",
parentid: parentRecordId,
hasDupe: true,
hasDupe: false,
parentName: row.getResultByName("parentTitle"),
dateAdded,
// Older Desktops use `pos` for deduping.