summaryrefslogtreecommitdiff
path: root/libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch
diff options
context:
space:
mode:
authorgrizzlyuser <grizzlyuser@protonmail.com>2022-07-30 18:37:35 +0200
committerbill-auger <mr.j.spam.me@gmail.com>2022-08-01 23:50:59 -0400
commit694801dd02f2f478f0e67f2815adb09c9f95ffc2 (patch)
treeda06d3e858e69d52cdc569b9526e2cdb384fe42f /libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch
parent576120558380347d9f068960b8d7f54d0f4e1ac0 (diff)
libre/iceweasel: 103.0-1.parabola1
* Update patches according to upstream changes * Remove patching of more-from-mozilla-qr-code-advanced.svg, dropped upstream [1]. * Add removal of winapi-{i686,x86_64}-pc-windows-gnu folders as these seem to contain some suspicious prebuilt static libraries [2] WARNING!!! Links can lead to nonfree works, like JavaScript frontend code, especially on GitHub. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1767066 [2] https://github.com/retep998/winapi-rs/issues?q=license
Diffstat (limited to 'libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch')
-rw-r--r--libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch246
1 files changed, 125 insertions, 121 deletions
diff --git a/libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch b/libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch
index 08ab1e2e8..6df6152c4 100644
--- a/libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch
+++ b/libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch
@@ -1,4 +1,4 @@
-From e2e22a52ee5e5cf9f7c55854b828bb65a919b563 Mon Sep 17 00:00:00 2001
+From e63cc6359790ab8d7139bf9cdf8e3b527ba780e6 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 17:20:39 +0200
Subject: [PATCH 01/13] Point to local omni.ja files, not remote server
@@ -47,10 +47,10 @@ index 0a9da8d804..fdc387aa63 100644
>
nimbus-desktop-experiments
diff --git a/browser/components/newtab/data/content/activity-stream.bundle.js b/browser/components/newtab/data/content/activity-stream.bundle.js
-index 3439547610..e4b170454c 100644
+index cb7c26e729..696813dd53 100644
--- a/browser/components/newtab/data/content/activity-stream.bundle.js
+++ b/browser/components/newtab/data/content/activity-stream.bundle.js
-@@ -1577,7 +1577,7 @@ class ASRouterAdminInner extends (external_React_default()).PureComponent {
+@@ -1576,7 +1576,7 @@ class ASRouterAdminInner extends (external_React_default()).PureComponent {
label = /*#__PURE__*/external_React_default().createElement("span", null, "remote settings (", /*#__PURE__*/external_React_default().createElement("a", {
className: "providerUrl",
target: "_blank",
@@ -60,10 +60,10 @@ index 3439547610..e4b170454c 100644
}, "nimbus-desktop-experiments"), ")");
}
diff --git a/services/settings/Utils.jsm b/services/settings/Utils.jsm
-index 31ad77d286..9f2e97f14c 100644
+index 23d6bf1a20..6f87bfa812 100644
--- a/services/settings/Utils.jsm
+++ b/services/settings/Utils.jsm
-@@ -106,7 +106,7 @@ var Utils = {
+@@ -108,7 +108,7 @@ var Utils = {
: AppConstants.REMOTE_SETTINGS_SERVER_URL;
},
@@ -86,10 +86,10 @@ index 3bc70462c4..dc9592c9fa 100755
# 1. List remote settings collections from server.
echo "INFO: fetch remote settings list from server"
diff --git a/toolkit/components/search/SearchUtils.jsm b/toolkit/components/search/SearchUtils.jsm
-index 0bf60e5f16..5561b885f6 100644
+index a3100fac89..3720829575 100644
--- a/toolkit/components/search/SearchUtils.jsm
+++ b/toolkit/components/search/SearchUtils.jsm
-@@ -158,13 +158,13 @@ var SearchUtils = {
+@@ -157,13 +157,13 @@ var SearchUtils = {
ENGINES_URLS: {
"prod-main":
@@ -129,10 +129,10 @@ index c782f9f7c3..4d773d27c5 100644
+.. _viewed live: resource://app/defaults/settings/main/search-config.json
.. _Normandy: /toolkit/components/normandy/normandy/services.html
diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm
-index 7f8ac95dd9..fc34169ea5 100644
+index 9311d06758..fd87704d83 100644
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
-@@ -420,9 +420,9 @@ this.AppConstants = Object.freeze({
+@@ -423,9 +423,9 @@ var AppConstants = Object.freeze({
REMOTE_SETTINGS_SERVER_URL:
#ifdef MOZ_THUNDERBIRD
@@ -158,10 +158,10 @@ index 667d9fc628..b2bf628f29 100644
#define PROD_CID "windows-default-browser-agent"
#define PROD_ID "state"
--
-2.37.0
+2.37.1
-From 9329ba8b85b542759a089818d70ba86d0a5b9a60 Mon Sep 17 00:00:00 2001
+From 1b75c1b90928d362b6b7723b57c3c0d501145807 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 17:34:08 +0200
Subject: [PATCH 02/13] Remove polling triggered by push broadcasts
@@ -174,11 +174,11 @@ the user profile, so that it doesn't get picked up by push broadcast
service.
---
dom/push/PushBroadcastService.jsm | 13 +++++++++++++
- services/settings/remote-settings.js | 7 ++-----
- 2 files changed, 15 insertions(+), 5 deletions(-)
+ services/settings/remote-settings.js | 11 ++---------
+ 2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/dom/push/PushBroadcastService.jsm b/dom/push/PushBroadcastService.jsm
-index 1ee7986f6a..db73413b1a 100644
+index 85c1bf6634..d2094ebb9c 100644
--- a/dom/push/PushBroadcastService.jsm
+++ b/dom/push/PushBroadcastService.jsm
@@ -179,6 +179,19 @@ var BroadcastService = class {
@@ -202,19 +202,23 @@ index 1ee7986f6a..db73413b1a 100644
* Call the listeners of the specified broadcasts.
*
diff --git a/services/settings/remote-settings.js b/services/settings/remote-settings.js
-index f7e8e24748..57d11d71b3 100644
+index bfe9226f88..01abff0fb1 100644
--- a/services/settings/remote-settings.js
+++ b/services/settings/remote-settings.js
-@@ -533,7 +533,7 @@ function remoteSettingsFunction() {
+@@ -580,11 +580,7 @@ function remoteSettingsFunction() {
moduleURI: __URI__,
symbolName: "remoteSettingsBroadcastHandler",
};
-- pushBroadcastService.addListener(BROADCAST_ID, currentVersion, moduleInfo);
-+ pushBroadcastService.deleteListener(BROADCAST_ID);
+- lazy.pushBroadcastService.addListener(
+- BROADCAST_ID,
+- currentVersion,
+- moduleInfo
+- );
++ lazy.pushBroadcastService.deleteListener(BROADCAST_ID);
};
return remoteSettings;
-@@ -553,9 +553,6 @@ var remoteSettingsBroadcastHandler = {
+@@ -604,9 +600,6 @@ var remoteSettingsBroadcastHandler = {
`Push notification received (version=${version} phase=${phase})`
);
@@ -226,10 +230,10 @@ index f7e8e24748..57d11d71b3 100644
},
};
--
-2.37.0
+2.37.1
-From 11631dd36d3eeecc5f22171d5e059fbe7662c77c Mon Sep 17 00:00:00 2001
+From 8b367f58916f12d73a392fa629673e3a797a1a64 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 17:41:54 +0200
Subject: [PATCH 03/13] Remove timer that triggers polling for changes
@@ -270,10 +274,10 @@ index 3bfed26ea4..807eb220ec 100644
-# see syntax https://searchfox.org/mozilla-central/rev/cc280c4be94ff8cf64a27cc9b3d6831ffa49fa45/toolkit/components/timermanager/UpdateTimerManager.jsm#155
-category update-timer RemoteSettingsComponents @mozilla.org/services/settings;1,getService,services-settings-poll-changes,services.settings.poll_interval,86400,259200
--
-2.37.0
+2.37.1
-From d720d5680fa97ad53998b6050bc28df4503f0c39 Mon Sep 17 00:00:00 2001
+From ea39895fee8e1dcf71b8779d33ae641a30dca384 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 17:47:41 +0200
Subject: [PATCH 04/13] Utils: fetch timestamps of each collection locally
@@ -304,10 +308,10 @@ index 73a41dc25b..04c2a3fb6a 100644
; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
diff --git a/services/settings/Utils.jsm b/services/settings/Utils.jsm
-index 9f2e97f14c..4e140f0fdd 100644
+index 6f87bfa812..8f878754a5 100644
--- a/services/settings/Utils.jsm
+++ b/services/settings/Utils.jsm
-@@ -377,7 +377,7 @@ var Utils = {
+@@ -380,7 +380,7 @@ var Utils = {
async fetchLatestChanges(serverUrl, options = {}) {
const { expectedTimestamp, lastEtag = "", filters = {} } = options;
@@ -316,7 +320,7 @@ index 9f2e97f14c..4e140f0fdd 100644
const params = {
...filters,
_expected: expectedTimestamp ?? 0,
-@@ -392,7 +392,11 @@ var Utils = {
+@@ -395,7 +395,11 @@ var Utils = {
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
.join("&");
}
@@ -329,7 +333,7 @@ index 9f2e97f14c..4e140f0fdd 100644
if (response.status >= 500) {
throw new Error(`Server error ${response.status} ${response.statusText}`);
-@@ -427,7 +431,15 @@ var Utils = {
+@@ -430,7 +434,15 @@ var Utils = {
}
}
@@ -373,10 +377,10 @@ index f407580bfa..53e9d8b45e 100644
]
--
-2.37.0
+2.37.1
-From 98496943d01589201771f69e14ba6b3cb7395e48 Mon Sep 17 00:00:00 2001
+From 442dd6b2fff0cd43c9e7e43d1d2bd63269ddc3c2 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 17:52:10 +0200
Subject: [PATCH 05/13] Utils: disable offline checking
@@ -384,22 +388,23 @@ Subject: [PATCH 05/13] Utils: disable offline checking
Since only local data is read now, it should always return false for the
current and any future code that relies on it.
---
- services/settings/Utils.jsm | 9 ---------
- 1 file changed, 9 deletions(-)
+ services/settings/Utils.jsm | 10 ----------
+ 1 file changed, 10 deletions(-)
diff --git a/services/settings/Utils.jsm b/services/settings/Utils.jsm
-index 4e140f0fdd..5d448da54c 100644
+index 8f878754a5..fdf7181c14 100644
--- a/services/settings/Utils.jsm
+++ b/services/settings/Utils.jsm
-@@ -192,15 +192,6 @@ var Utils = {
+@@ -194,16 +194,6 @@ var Utils = {
* @return {bool} Whether network is down or not.
*/
get isOffline() {
- try {
- return (
- Services.io.offline ||
-- CaptivePortalService.state == CaptivePortalService.LOCKED_PORTAL ||
-- !gNetworkLinkService.isLinkUp
+- lazy.CaptivePortalService.state ==
+- lazy.CaptivePortalService.LOCKED_PORTAL ||
+- !lazy.gNetworkLinkService.isLinkUp
- );
- } catch (ex) {
- log.warn("Could not determine network status.", ex);
@@ -408,10 +413,10 @@ index 4e140f0fdd..5d448da54c 100644
},
--
-2.37.0
+2.37.1
-From 738c1836a53ead5253ab3e0f9750aec94192dff0 Mon Sep 17 00:00:00 2001
+From c2f06f79b0d5d78ab3a81ec7f85053d7b3e761af Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 17:56:02 +0200
Subject: [PATCH 06/13] Refactor hashing logic to a separate function
@@ -424,25 +429,25 @@ integrity checking of the locally cached data.
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/services/settings/RemoteSettingsWorker.jsm b/services/settings/RemoteSettingsWorker.jsm
-index 147ebb6b13..c86e218fd3 100644
+index 9fc1794f90..50e69f56a0 100644
--- a/services/settings/RemoteSettingsWorker.jsm
+++ b/services/settings/RemoteSettingsWorker.jsm
-@@ -189,6 +189,10 @@ class Worker {
+@@ -191,6 +191,10 @@ class Worker {
// task on the current thread instead of the worker thread.
- return SharedUtils.checkContentHash(buffer, size, hash);
+ return lazy.SharedUtils.checkContentHash(buffer, size, hash);
}
+
+ async getContentHash(bytes) {
-+ return SharedUtils.getContentHash(bytes);
++ return lazy.SharedUtils.getContentHash(bytes);
+ }
}
// Now, first add a shutdown blocker. If that fails, we must have
diff --git a/services/settings/SharedUtils.jsm b/services/settings/SharedUtils.jsm
-index 5d32fb38bd..753a1b1393 100644
+index 9804e80c91..de67b0fb6f 100644
--- a/services/settings/SharedUtils.jsm
+++ b/services/settings/SharedUtils.jsm
-@@ -28,11 +28,16 @@ var SharedUtils = {
+@@ -23,11 +23,16 @@ var SharedUtils = {
return false;
}
// Has expected content?
@@ -462,10 +467,10 @@ index 5d32fb38bd..753a1b1393 100644
/**
--
-2.37.0
+2.37.1
-From fa07a0a3fbd62a0d973a4ca07fdc3a5cf2209841 Mon Sep 17 00:00:00 2001
+From f9aa27662b2018a543d71e2443397beecc73ee5e Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 18:05:02 +0200
Subject: [PATCH 07/13] Client: Fetch and hash records from local dump
@@ -500,16 +505,16 @@ the upgrade to local-only setup.
1 file changed, 27 insertions(+), 36 deletions(-)
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
-index eee1487491..90e82772c4 100644
+index 2b07a06b26..77da7304b6 100644
--- a/services/settings/RemoteSettingsClient.jsm
+++ b/services/settings/RemoteSettingsClient.jsm
-@@ -592,11 +592,9 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -668,11 +668,9 @@ class RemoteSettingsClient extends EventEmitter {
// If the data is up-to-date but don't have metadata (records loaded from dump),
// we fetch them and validate the signature immediately.
-- if (this.verifySignature && ObjectUtils.isEmpty(localMetadata)) {
-+ if (this.verifySignature && ObjectUtils.isEmpty(localMetadata?.json_dump_metadata)) {
- console.debug(`${this.identifier} pull collection metadata`);
+- if (this.verifySignature && lazy.ObjectUtils.isEmpty(localMetadata)) {
++ if (this.verifySignature && lazy.ObjectUtils.isEmpty(localMetadata?.json_dump_metadata)) {
+ lazy.console.debug(`${this.identifier} pull collection metadata`);
- const metadata = await this.httpClient().getData({
- query: { _expected: expectedTimestamp },
- });
@@ -517,7 +522,7 @@ index eee1487491..90e82772c4 100644
await this.db.importChanges(metadata);
// We don't bother validating the signature if the dump was just loaded. We do
// if the dump was loaded at some other point (eg. from .get()).
-@@ -825,33 +823,23 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -935,33 +933,23 @@ class RemoteSettingsClient extends EventEmitter {
* @returns {Promise}
*/
async _validateCollectionSignature(records, timestamp, metadata) {
@@ -537,9 +542,9 @@ index eee1487491..90e82772c4 100644
- signature: { x5u, signature },
+ json_dump_metadata: { hash, size },
} = metadata;
-- const certChain = await (await Utils.fetch(x5u)).text();
+- const certChain = await (await lazy.Utils.fetch(x5u)).text();
// Merge remote records with local ones and serialize as canonical JSON.
- const serialized = await RemoteSettingsWorker.canonicalStringify(
+ const serialized = await lazy.RemoteSettingsWorker.canonicalStringify(
records,
timestamp
);
@@ -549,15 +554,15 @@ index eee1487491..90e82772c4 100644
- "p384ecdsa=" + signature,
- certChain,
- this.signerName,
-- Utils.CERT_CHAIN_ROOT_IDENTIFIER
-+ !(await RemoteSettingsWorker.checkContentHash(
+- lazy.Utils.CERT_CHAIN_ROOT_IDENTIFIER
++ !(await lazy.RemoteSettingsWorker.checkContentHash(
+ new TextEncoder().encode(serialized),
+ size,
+ hash
))
) {
throw new InvalidSignatureError(this.identifier);
-@@ -1024,24 +1012,27 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -1134,24 +1122,27 @@ class RemoteSettingsClient extends EventEmitter {
* @param since timestamp of last sync (optional)
*/
async _fetchChangeset(expectedTimestamp, since) {
@@ -576,21 +581,21 @@ index eee1487491..90e82772c4 100644
- _since: since,
- },
- }
-+ const { data } = await SharedUtils.loadJSONDump(
++ const { data } = await lazy.SharedUtils.loadJSONDump(
+ this.bucketName,
+ this.collectionName
- );
++ );
+ const remoteRecords = data ?? [];
+
-+ const serialized = await RemoteSettingsWorker.canonicalStringify(
++ const serialized = await lazy.RemoteSettingsWorker.canonicalStringify(
+ remoteRecords,
+ expectedTimestamp
-+ );
+ );
+ const bytes = new TextEncoder().encode(serialized);
+ const metadata = {
+ app_build_id: Services.appinfo.appBuildID,
+ json_dump_metadata: {
-+ hash: await RemoteSettingsWorker.getContentHash(bytes),
++ hash: await lazy.RemoteSettingsWorker.getContentHash(bytes),
+ size: bytes.length,
+ },
+ }
@@ -602,10 +607,10 @@ index eee1487491..90e82772c4 100644
remoteRecords,
};
--
-2.37.0
+2.37.1
-From 9e4840347d561c7dc98ab6f84e3c3a195297c29e Mon Sep 17 00:00:00 2001
+From aa6967b7f10899464253074271f27180ca4069fe Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 18:42:56 +0200
Subject: [PATCH 08/13] Client: start deferred sync on get() or on()
@@ -623,45 +628,42 @@ false, it triggers a sync. Then adds a flag if the client has been
correctly synchronized with the dump, so that no metadata checking
occurs during the session.
---
- services/settings/RemoteSettingsClient.jsm | 30 +++++++++++++++++++++-
- 1 file changed, 29 insertions(+), 1 deletion(-)
+ services/settings/RemoteSettingsClient.jsm | 27 +++++++++++++++++++++-
+ 1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
-index 90e82772c4..2a009eca7c 100644
+index 77da7304b6..81404d9801 100644
--- a/services/settings/RemoteSettingsClient.jsm
+++ b/services/settings/RemoteSettingsClient.jsm
-@@ -16,6 +16,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
+@@ -23,6 +23,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
ClientEnvironmentBase:
"resource://gre/modules/components-utils/ClientEnvironment.jsm",
Database: "resource://services-settings/Database.jsm",
+ DeferredTask: "resource://gre/modules/DeferredTask.jsm",
- Downloader: "resource://services-settings/Attachments.jsm",
IDBHelpers: "resource://services-settings/IDBHelpers.jsm",
KintoHttpClient: "resource://services-common/kinto-http-client.js",
-@@ -27,6 +28,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
+ ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
+@@ -33,6 +34,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
});
const TELEMETRY_COMPONENT = "remotesettings";
+const DEFERRED_SYNC_DELAY_MILLISECONDS = 1000;
- XPCOMUtils.defineLazyGetter(this, "console", () => Utils.log);
+ XPCOMUtils.defineLazyGetter(lazy, "console", () => lazy.Utils.log);
-@@ -249,6 +251,14 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -320,6 +322,11 @@ class RemoteSettingsClient extends EventEmitter {
this._lastCheckTimePref = lastCheckTimePref;
this._verifier = null;
this._syncRunning = false;
-+ this._deferredSync = new DeferredTask(
-+ async () => {
-+ if (!this._syncRunning && !(await this._isSynced())) {
-+ await this.sync();
-+ }
-+ },
-+ DEFERRED_SYNC_DELAY_MILLISECONDS
-+ );
++ this._deferredSync = new lazy.DeferredTask(async () => {
++ if (!this._syncRunning && !(await this._isSynced())) {
++ await this.sync();
++ }
++ }, DEFERRED_SYNC_DELAY_MILLISECONDS);
// This attribute allows signature verification to be disabled, when running tests
// or when pulling data from a dev server.
-@@ -278,6 +288,11 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -349,6 +356,11 @@ class RemoteSettingsClient extends EventEmitter {
this.db.identifier = this.identifier;
}
@@ -673,7 +675,7 @@ index 90e82772c4..2a009eca7c 100644
get identifier() {
return `${this.bucketName}/${this.collectionName}`;
}
-@@ -346,6 +361,10 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -417,6 +429,10 @@ class RemoteSettingsClient extends EventEmitter {
let lastModified = await this.db.getLastModified();
let hasLocalData = lastModified !== null;
@@ -684,7 +686,7 @@ index 90e82772c4..2a009eca7c 100644
if (syncIfEmpty && !hasLocalData) {
// .get() was called before we had the chance to synchronize the local database.
// We'll try to avoid returning an empty list.
-@@ -444,7 +463,10 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -517,7 +533,10 @@ class RemoteSettingsClient extends EventEmitter {
// No need to verify signature on JSON dumps.
// If local DB cannot be read, then we don't even try to do anything,
// we return results early.
@@ -695,14 +697,14 @@ index 90e82772c4..2a009eca7c 100644
+ return filtered;
}
- console.debug(
-@@ -484,6 +506,12 @@ class RemoteSettingsClient extends EventEmitter {
+ lazy.console.debug(
+@@ -557,6 +576,12 @@ class RemoteSettingsClient extends EventEmitter {
return final;
}
+ async _isSynced() {
+ this._synced ||=
-+ Services.appinfo.appBuildID === (await this.db.getMetadata())?.app_build_id;
++ Services.appinfo.appBuildID === (await this.db?.getMetadata())?.app_build_id;
+ return this._synced;
+ }
+
@@ -710,10 +712,10 @@ index 90e82772c4..2a009eca7c 100644
* Synchronize the local database with the remote server.
*
--
-2.37.0
+2.37.1
-From 72de3dbe162430638a58838b714f1872c2dd8195 Mon Sep 17 00:00:00 2001
+From d38df88747ef8df356af5178fde18bf3a25836b6 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 18:53:51 +0200
Subject: [PATCH 09/13] Client: deep compare records if timestamps match
@@ -735,34 +737,34 @@ noticeable performance issues.
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
-index 2a009eca7c..dbcdb559df 100644
+index 81404d9801..c06650e2d8 100644
--- a/services/settings/RemoteSettingsClient.jsm
+++ b/services/settings/RemoteSettingsClient.jsm
-@@ -13,6 +13,7 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+@@ -20,6 +20,7 @@ const { Downloader } = ChromeUtils.import(
+ const lazy = {};
- XPCOMUtils.defineLazyModuleGetters(this, {
- AppConstants: "resource://gre/modules/AppConstants.jsm",
+ XPCOMUtils.defineLazyModuleGetters(lazy, {
+ CanonicalJSON: "resource://gre/modules/CanonicalJSON.jsm",
ClientEnvironmentBase:
"resource://gre/modules/components-utils/ClientEnvironment.jsm",
Database: "resource://services-settings/Database.jsm",
-@@ -1015,7 +1016,10 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -1122,7 +1123,10 @@ class RemoteSettingsClient extends EventEmitter {
const old = oldById.get(r.id);
if (old) {
oldById.delete(r.id);
- if (r.last_modified != old.last_modified) {
+ if (
+ r.last_modified != old.last_modified ||
-+ CanonicalJSON.stringify(r) != CanonicalJSON.stringify(old)
++ lazy.CanonicalJSON.stringify(r) != lazy.CanonicalJSON.stringify(old)
+ ) {
syncResult.updated.push({ old, new: r });
}
} else {
--
-2.37.0
+2.37.1
-From 0ddc970c40569ca7b20ec67a413519589e7c52f6 Mon Sep 17 00:00:00 2001
+From f746bdc4a82e8a29ea8a5470cb5cdedba6594dbc Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 19:01:39 +0200
Subject: [PATCH 10/13] Client: delete more data on cleanup
@@ -780,10 +782,10 @@ logic gets the data about the attachments from those records.
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
-index dbcdb559df..c20ce412b2 100644
+index c06650e2d8..d5d934447a 100644
--- a/services/settings/RemoteSettingsClient.jsm
+++ b/services/settings/RemoteSettingsClient.jsm
-@@ -207,7 +207,7 @@ class AttachmentDownloader extends Downloader {
+@@ -257,7 +257,7 @@ class AttachmentDownloader extends Downloader {
allRecords
.filter(r => !!r.attachment)
.map(r =>
@@ -792,16 +794,16 @@ index dbcdb559df..c20ce412b2 100644
)
);
}
-@@ -975,7 +975,7 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -1082,7 +1082,7 @@ class RemoteSettingsClient extends EventEmitter {
// Signature failed, clear local DB because it contains
// bad data (local + remote changes).
- console.debug(`${this.identifier} clear local data`);
+ lazy.console.debug(`${this.identifier} clear local data`);
- await this.db.clear();
+ await this._clearAll();
// Local data was tampered, throw and it will retry from empty DB.
- console.error(`${this.identifier} local data was corrupted`);
+ lazy.console.error(`${this.identifier} local data was corrupted`);
throw new CorruptedDataError(this.identifier);
-@@ -997,7 +997,7 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -1104,7 +1104,7 @@ class RemoteSettingsClient extends EventEmitter {
// _importJSONDump() only clears DB if dump is available,
// therefore do it here!
if (imported < 0) {
@@ -810,7 +812,7 @@ index dbcdb559df..c20ce412b2 100644
}
}
}
-@@ -1037,6 +1037,12 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -1144,6 +1144,12 @@ class RemoteSettingsClient extends EventEmitter {
return syncResult;
}
@@ -824,10 +826,10 @@ index dbcdb559df..c20ce412b2 100644
* Fetch information from changeset endpoint.
*
--
-2.37.0
+2.37.1
-From 00e45ee5b33b5e6030fa2d3b589cce5418822a3e Mon Sep 17 00:00:00 2001
+From 3e2487052231283079591eb158d6f45b43f1c091 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 19:07:56 +0200
Subject: [PATCH 11/13] Client: remove comparison of collection timestamps
@@ -842,16 +844,16 @@ necessary cleanup. So remove the checks.
1 file changed, 5 deletions(-)
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
-index c20ce412b2..79ec40ee9e 100644
+index d5d934447a..9a25d5103d 100644
--- a/services/settings/RemoteSettingsClient.jsm
+++ b/services/settings/RemoteSettingsClient.jsm
-@@ -917,14 +917,9 @@ class RemoteSettingsClient extends EventEmitter {
+@@ -1024,14 +1024,9 @@ class RemoteSettingsClient extends EventEmitter {
updated: [],
deleted: [],
};
- // If data wasn't changed, return empty sync result.
- // This can happen when we update the signature but not the data.
- console.debug(
+ lazy.console.debug(
`${this.identifier} local timestamp: ${localTimestamp}, remote: ${remoteTimestamp}`
);
- if (localTimestamp && remoteTimestamp < localTimestamp) {
@@ -861,20 +863,20 @@ index c20ce412b2..79ec40ee9e 100644
await this.db.importChanges(metadata, remoteTimestamp, remoteRecords, {
clear: retry,
--
-2.37.0
+2.37.1
-From 37d74c55d8c1d852666f179fe6ea45fd99ff83ca Mon Sep 17 00:00:00 2001
+From ba7f771d057358ae0575f0f392116b4406b6c1a5 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 19:15:44 +0200
Subject: [PATCH 12/13] Attachments: load only from dump and drop cached
---
- services/settings/Attachments.jsm | 35 +++++++------------------------
- 1 file changed, 8 insertions(+), 27 deletions(-)
+ services/settings/Attachments.jsm | 37 +++++++------------------------
+ 1 file changed, 8 insertions(+), 29 deletions(-)
diff --git a/services/settings/Attachments.jsm b/services/settings/Attachments.jsm
-index 2bf846e4e1..542f34f97e 100644
+index 5ac6249f67..9dc7bcdbf0 100644
--- a/services/settings/Attachments.jsm
+++ b/services/settings/Attachments.jsm
@@ -151,9 +151,10 @@ class Downloader {
@@ -915,7 +917,7 @@ index 2bf846e4e1..542f34f97e 100644
const {
attachment: { filename, size, hash },
} = record;
-@@ -357,31 +359,10 @@ class Downloader {
+@@ -359,33 +361,10 @@ class Downloader {
*/
async downloadAsBytes(record, options = {}) {
const {
@@ -934,7 +936,9 @@ index 2bf846e4e1..542f34f97e 100644
- if (!checkHash) {
- return buffer;
- }
-- if (await RemoteSettingsWorker.checkContentHash(buffer, size, hash)) {
+- if (
+- await lazy.RemoteSettingsWorker.checkContentHash(buffer, size, hash)
+- ) {
- return buffer;
- }
- // Content is corrupted.
@@ -951,10 +955,10 @@ index 2bf846e4e1..542f34f97e 100644
/**
--
-2.37.0
+2.37.1
-From 5f475d79389de681e2eac63527a6d497b0b0da77 Mon Sep 17 00:00:00 2001
+From 1c0858235dd0f65b00ed622eac269d35c24ee458 Mon Sep 17 00:00:00 2001
From: grizzlyuser <grizzlyuser@protonmail.com>
Date: Wed, 30 Dec 2020 19:22:20 +0200
Subject: [PATCH 13/13] Disable CRLite entirely for now
@@ -979,10 +983,10 @@ certificate revocations.
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
-index c487b04a35..b0808338ef 100644
+index 79267cded6..d67f43052a 100644
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
-@@ -12269,7 +12269,7 @@
+@@ -12446,7 +12446,7 @@
# 3: Consult CRLite and enforce "Not Revoked" results, but defer to OCSP for "Revoked".
- name: security.pki.crlite_mode
type: RelaxedAtomicUint32
@@ -992,10 +996,10 @@ index c487b04a35..b0808338ef 100644
- name: security.tls.version.min
diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp
-index 12da07c56f..39f85cf5b3 100644
+index 0996c198d2..f8525a9325 100644
--- a/security/manager/ssl/nsNSSComponent.cpp
+++ b/security/manager/ssl/nsNSSComponent.cpp
-@@ -1453,6 +1453,7 @@ void nsNSSComponent::setValidationOptions(
+@@ -1434,6 +1434,7 @@ void nsNSSComponent::setValidationOptions(
CRLiteMode defaultCRLiteMode = CRLiteMode::Disabled;
CRLiteMode crliteMode =
static_cast<CRLiteMode>(StaticPrefs::security_pki_crlite_mode());
@@ -1004,5 +1008,5 @@ index 12da07c56f..39f85cf5b3 100644
case CRLiteMode::Disabled:
case CRLiteMode::TelemetryOnly:
--
-2.37.0
+2.37.1