From cbc46b9b1d8c2ef6af24249d5a538c1349f4c1d3 Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Thu, 9 Feb 2023 21:21:51 +0000 Subject: [PATCH] Bug 1744866: Observe bookmark-guid-changed event to up score. r=mak Differential Revision: https://phabricator.services.mozilla.com/D130441 --- services/sync/modules/engines/bookmarks.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/services/sync/modules/engines/bookmarks.js b/services/sync/modules/engines/bookmarks.js index d2fae2c07f80..080b763987a9 100644 --- a/services/sync/modules/engines/bookmarks.js +++ b/services/sync/modules/engines/bookmarks.js @@ -807,6 +807,7 @@ BookmarksTracker.prototype = { "bookmark-added", "bookmark-removed", "bookmark-moved", + "bookmark-guid-changed", "bookmark-keyword-changed", "bookmark-tags-changed", "bookmark-time-changed", @@ -826,6 +827,7 @@ BookmarksTracker.prototype = { "bookmark-added", "bookmark-removed", "bookmark-moved", + "bookmark-guid-changed", "bookmark-keyword-changed", "bookmark-tags-changed", "bookmark-time-changed", @@ -883,7 +885,6 @@ BookmarksTracker.prototype = { case "bookmark-added": case "bookmark-removed": case "bookmark-moved": - case "bookmark-guid-changed": case "bookmark-keyword-changed": case "bookmark-tags-changed": case "bookmark-time-changed": @@ -893,6 +894,17 @@ BookmarksTracker.prototype = { continue; } + this._log.trace(`'${event.type}': ${event.id}`); + this._upScore(); + break; + case "bookmark-guid-changed": + if (event.source !== lazy.PlacesUtils.bookmarks.SOURCES.SYNC) { + this._log.warn( + "The source of bookmark-guid-changed event shoud be sync." + ); + continue; + } + this._log.trace(`'${event.type}': ${event.id}`); this._upScore(); break;