| |
@@ -1,4 +1,4 @@
|
| |
- From e2e22a52ee5e5cf9f7c55854b828bb65a919b563 Mon Sep 17 00:00:00 2001
|
| |
+ From 07801d1961effd9182c80a990a23f338e3972efb 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
|
| |
@@ -26,18 +26,19 @@
|
| |
.../newtab/data/content/activity-stream.bundle.js | 2 +-
|
| |
services/settings/Utils.jsm | 2 +-
|
| |
.../periodic-updates/scripts/periodic_file_updates.sh | 2 +-
|
| |
- toolkit/components/search/SearchUtils.jsm | 8 ++++----
|
| |
+ .../components/backgroundtasks/BackgroundTask_message.jsm | 4 ++--
|
| |
+ toolkit/components/search/SearchUtils.sys.mjs | 8 ++++----
|
| |
toolkit/components/search/docs/DefaultSearchEngines.rst | 2 +-
|
| |
.../components/search/docs/SearchEngineConfiguration.rst | 2 +-
|
| |
toolkit/modules/AppConstants.jsm | 4 ++--
|
| |
toolkit/mozapps/defaultagent/RemoteSettings.cpp | 2 +-
|
| |
- 9 files changed, 13 insertions(+), 13 deletions(-)
|
| |
+ 10 files changed, 15 insertions(+), 15 deletions(-)
|
| |
|
| |
diff --git a/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx b/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx
|
| |
- index 0a9da8d804..fdc387aa63 100644
|
| |
+ index e663fbd32b..a7b7a1994f 100644
|
| |
--- a/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx
|
| |
+++ b/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx
|
| |
- @@ -1226,7 +1226,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
| |
+ @@ -1116,7 +1116,7 @@ export class ASRouterAdminInner extends React.PureComponent {
|
| |
<a
|
| |
className="providerUrl"
|
| |
target="_blank"
|
| |
@@ -47,10 +48,10 @@
|
| |
>
|
| |
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 938b44f87b..cdfd5b8589 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 {
|
| |
+ @@ -1487,7 +1487,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 +61,10 @@
|
| |
}, "nimbus-desktop-experiments"), ")");
|
| |
}
|
| |
diff --git a/services/settings/Utils.jsm b/services/settings/Utils.jsm
|
| |
- index 31ad77d286..9f2e97f14c 100644
|
| |
+ index a8b0c67ce1..9761486718 100644
|
| |
--- a/services/settings/Utils.jsm
|
| |
+++ b/services/settings/Utils.jsm
|
| |
- @@ -106,7 +106,7 @@ var Utils = {
|
| |
+ @@ -107,7 +107,7 @@ var Utils = {
|
| |
: AppConstants.REMOTE_SETTINGS_SERVER_URL;
|
| |
},
|
| |
|
| |
@@ -73,7 +74,7 @@
|
| |
/**
|
| |
* Logger instance.
|
| |
diff --git a/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh b/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
|
| |
- index 3bc70462c4..dc9592c9fa 100755
|
| |
+ index f177a1440c..c41b0beece 100755
|
| |
--- a/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
|
| |
+++ b/taskcluster/docker/periodic-updates/scripts/periodic_file_updates.sh
|
| |
@@ -285,7 +285,7 @@ function compare_suffix_lists {
|
| |
@@ -85,11 +86,26 @@
|
| |
|
| |
# 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
|
| |
- --- a/toolkit/components/search/SearchUtils.jsm
|
| |
- +++ b/toolkit/components/search/SearchUtils.jsm
|
| |
- @@ -158,13 +158,13 @@ var SearchUtils = {
|
| |
+ diff --git a/toolkit/components/backgroundtasks/BackgroundTask_message.sys.mjs b/toolkit/components/backgroundtasks/BackgroundTask_message.sys.mjs
|
| |
+ index 55e8f70e77..2b5167b36b 100644
|
| |
+ --- a/toolkit/components/backgroundtasks/BackgroundTask_message.sys.mjs
|
| |
+ +++ b/toolkit/components/backgroundtasks/BackgroundTask_message.sys.mjs
|
| |
+ @@ -19,8 +19,8 @@
|
| |
+ // environment variables still apply.
|
| |
+ //
|
| |
+ // --stage: use stage Remote Settings
|
| |
+ -// (`https://settings-cdn.stage.mozaws.net/v1`) rather than production
|
| |
+ -// (`https://firefox.settings.services.mozilla.com/v1`)
|
| |
+ +// (`resource://app/defaults/settings/`) rather than production
|
| |
+ +// (`resource://app/defaults/settings/`)
|
| |
+ //
|
| |
+ // --preview: enable Remote Settings and Experiment previews.
|
| |
+ //
|
| |
+ diff --git a/toolkit/components/search/SearchUtils.sys.mjs b/toolkit/components/search/SearchUtils.sys.mjs
|
| |
+ index a3072d19b3..d24df38913 100644
|
| |
+ --- a/toolkit/components/search/SearchUtils.sys.mjs
|
| |
+ +++ b/toolkit/components/search/SearchUtils.sys.mjs
|
| |
+ @@ -154,13 +154,13 @@ export var SearchUtils = {
|
| |
|
| |
ENGINES_URLS: {
|
| |
"prod-main":
|
| |
@@ -129,10 +145,10 @@
|
| |
+.. _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 15125bcca0..1b3e502730 100644
|
| |
--- a/toolkit/modules/AppConstants.jsm
|
| |
+++ b/toolkit/modules/AppConstants.jsm
|
| |
- @@ -420,9 +420,9 @@ this.AppConstants = Object.freeze({
|
| |
+ @@ -420,9 +420,9 @@ var AppConstants = Object.freeze({
|
| |
|
| |
REMOTE_SETTINGS_SERVER_URL:
|
| |
#ifdef MOZ_THUNDERBIRD
|
| |
@@ -158,10 +174,10 @@
|
| |
#define PROD_CID "windows-default-browser-agent"
|
| |
#define PROD_ID "state"
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 9329ba8b85b542759a089818d70ba86d0a5b9a60 Mon Sep 17 00:00:00 2001
|
| |
+ From 70b74406d004aa6a4da38d179495f767ec583e58 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 +190,11 @@
|
| |
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 80df53ee49..109d602d4a 100644
|
| |
--- a/dom/push/PushBroadcastService.jsm
|
| |
+++ b/dom/push/PushBroadcastService.jsm
|
| |
@@ -179,6 +179,19 @@ var BroadcastService = class {
|
| |
@@ -202,19 +218,23 @@
|
| |
* 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 44727dfc0e..ece21d09bc 100644
|
| |
--- a/services/settings/remote-settings.js
|
| |
+++ b/services/settings/remote-settings.js
|
| |
- @@ -533,7 +533,7 @@ function remoteSettingsFunction() {
|
| |
+ @@ -582,11 +582,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 = {
|
| |
+ @@ -606,9 +602,6 @@ var remoteSettingsBroadcastHandler = {
|
| |
`Push notification received (version=${version} phase=${phase})`
|
| |
);
|
| |
|
| |
@@ -226,10 +246,10 @@
|
| |
},
|
| |
};
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 11631dd36d3eeecc5f22171d5e059fbe7662c77c Mon Sep 17 00:00:00 2001
|
| |
+ From 9f91207a91cb895a67f90f5e2e4e3968e8bd7b0e 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 +290,10 @@
|
| |
-# 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.2
|
| |
|
| |
|
| |
- From d720d5680fa97ad53998b6050bc28df4503f0c39 Mon Sep 17 00:00:00 2001
|
| |
+ From 8f0541899626807c4cb11996b5763463f3b9dc6f 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
|
| |
@@ -292,10 +312,10 @@
|
| |
create mode 100644 services/settings/dumps/monitor/moz.build
|
| |
|
| |
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
|
| |
- index 73a41dc25b..04c2a3fb6a 100644
|
| |
+ index 14e582fc61..821b1e2167 100644
|
| |
--- a/browser/installer/package-manifest.in
|
| |
+++ b/browser/installer/package-manifest.in
|
| |
- @@ -275,6 +275,7 @@
|
| |
+ @@ -259,6 +259,7 @@
|
| |
@RESPATH@/browser/defaults/settings/last_modified.json
|
| |
@RESPATH@/browser/defaults/settings/blocklists
|
| |
@RESPATH@/browser/defaults/settings/main
|
| |
@@ -304,10 +324,10 @@
|
| |
|
| |
; 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 9761486718..da55d60201 100644
|
| |
--- a/services/settings/Utils.jsm
|
| |
+++ b/services/settings/Utils.jsm
|
| |
- @@ -377,7 +377,7 @@ var Utils = {
|
| |
+ @@ -379,7 +379,7 @@ var Utils = {
|
| |
async fetchLatestChanges(serverUrl, options = {}) {
|
| |
const { expectedTimestamp, lastEtag = "", filters = {} } = options;
|
| |
|
| |
@@ -316,7 +336,7 @@
|
| |
const params = {
|
| |
...filters,
|
| |
_expected: expectedTimestamp ?? 0,
|
| |
- @@ -392,7 +392,11 @@ var Utils = {
|
| |
+ @@ -394,7 +394,11 @@ var Utils = {
|
| |
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
|
| |
.join("&");
|
| |
}
|
| |
@@ -329,7 +349,7 @@
|
| |
|
| |
if (response.status >= 500) {
|
| |
throw new Error(`Server error ${response.status} ${response.statusText}`);
|
| |
- @@ -427,7 +431,15 @@ var Utils = {
|
| |
+ @@ -429,7 +433,15 @@ var Utils = {
|
| |
}
|
| |
}
|
| |
|
| |
@@ -373,10 +393,10 @@
|
| |
]
|
| |
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 98496943d01589201771f69e14ba6b3cb7395e48 Mon Sep 17 00:00:00 2001
|
| |
+ From dca0c5d7c983a24d742c45705a899430afed41bd 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 +404,23 @@
|
| |
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 da55d60201..ff45380ff8 100644
|
| |
--- a/services/settings/Utils.jsm
|
| |
+++ b/services/settings/Utils.jsm
|
| |
- @@ -192,15 +192,6 @@ var Utils = {
|
| |
+ @@ -193,16 +193,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 +429,10 @@
|
| |
},
|
| |
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 738c1836a53ead5253ab3e0f9750aec94192dff0 Mon Sep 17 00:00:00 2001
|
| |
+ From 1e29854983d5fcc360a6b407b4cd11f6af8d993e 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 +445,25 @@
|
| |
2 files changed, 11 insertions(+), 2 deletions(-)
|
| |
|
| |
diff --git a/services/settings/RemoteSettingsWorker.jsm b/services/settings/RemoteSettingsWorker.jsm
|
| |
- index 147ebb6b13..c86e218fd3 100644
|
| |
+ index 2e8073271b..24b4ce2af8 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 +483,10 @@
|
| |
|
| |
/**
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From fa07a0a3fbd62a0d973a4ca07fdc3a5cf2209841 Mon Sep 17 00:00:00 2001
|
| |
+ From 49543366ee33ad44a5577d082e51a11a2e7b4b7f 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 +521,16 @@
|
| |
1 file changed, 27 insertions(+), 36 deletions(-)
|
| |
|
| |
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
|
| |
- index eee1487491..90e82772c4 100644
|
| |
+ index ae94f272d8..75589ff02e 100644
|
| |
--- a/services/settings/RemoteSettingsClient.jsm
|
| |
+++ b/services/settings/RemoteSettingsClient.jsm
|
| |
- @@ -592,11 +592,9 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
+ @@ -678,11 +678,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 +538,7 @@
|
| |
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 {
|
| |
+ @@ -945,33 +943,23 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
* @returns {Promise}
|
| |
*/
|
| |
async _validateCollectionSignature(records, timestamp, metadata) {
|
| |
@@ -537,9 +558,9 @@
|
| |
- 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 +570,15 @@
|
| |
- "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 {
|
| |
+ @@ -1144,24 +1132,27 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
* @param since timestamp of last sync (optional)
|
| |
*/
|
| |
async _fetchChangeset(expectedTimestamp, since) {
|
| |
@@ -576,21 +597,21 @@
|
| |
- _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 +623,10 @@
|
| |
remoteRecords,
|
| |
};
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 9e4840347d561c7dc98ab6f84e3c3a195297c29e Mon Sep 17 00:00:00 2001
|
| |
+ From b6ce5faacf9bdf97066c7182399b58d5ef91a445 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 +644,42 @@
|
| |
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 75589ff02e..90280fc848 100644
|
| |
--- a/services/settings/RemoteSettingsClient.jsm
|
| |
+++ b/services/settings/RemoteSettingsClient.jsm
|
| |
- @@ -16,6 +16,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
| |
+ @@ -22,6 +22,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",
|
| |
+ @@ -32,6 +33,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 {
|
| |
+ @@ -319,6 +321,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 {
|
| |
+ @@ -348,6 +355,11 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
this.db.identifier = this.identifier;
|
| |
}
|
| |
|
| |
@@ -673,7 +691,7 @@
|
| |
get identifier() {
|
| |
return `${this.bucketName}/${this.collectionName}`;
|
| |
}
|
| |
- @@ -346,6 +361,10 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
+ @@ -419,6 +431,10 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
let lastModified = await this.db.getLastModified();
|
| |
let hasLocalData = lastModified !== null;
|
| |
|
| |
@@ -684,7 +702,7 @@
|
| |
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 {
|
| |
+ @@ -527,7 +543,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 +713,14 @@
|
| |
+ return filtered;
|
| |
}
|
| |
|
| |
- console.debug(
|
| |
- @@ -484,6 +506,12 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
+ lazy.console.debug(
|
| |
+ @@ -567,6 +586,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 +728,10 @@
|
| |
* Synchronize the local database with the remote server.
|
| |
*
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 72de3dbe162430638a58838b714f1872c2dd8195 Mon Sep 17 00:00:00 2001
|
| |
+ From 617d90b265e5d82aa964247f3bd68eb92ebd2cf0 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 +753,34 @@
|
| |
1 file changed, 5 insertions(+), 1 deletion(-)
|
| |
|
| |
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
|
| |
- index 2a009eca7c..dbcdb559df 100644
|
| |
+ index 90280fc848..3d9f04696f 100644
|
| |
--- a/services/settings/RemoteSettingsClient.jsm
|
| |
+++ b/services/settings/RemoteSettingsClient.jsm
|
| |
- @@ -13,6 +13,7 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
| |
+ @@ -19,6 +19,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 {
|
| |
+ @@ -1132,7 +1133,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.2
|
| |
|
| |
|
| |
- From 0ddc970c40569ca7b20ec67a413519589e7c52f6 Mon Sep 17 00:00:00 2001
|
| |
+ From 66122f118e859c33f1d972b658340dfc43b4b875 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 +798,10 @@
|
| |
1 file changed, 9 insertions(+), 3 deletions(-)
|
| |
|
| |
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
|
| |
- index dbcdb559df..c20ce412b2 100644
|
| |
+ index 3d9f04696f..e102c8b89d 100644
|
| |
--- a/services/settings/RemoteSettingsClient.jsm
|
| |
+++ b/services/settings/RemoteSettingsClient.jsm
|
| |
- @@ -207,7 +207,7 @@ class AttachmentDownloader extends Downloader {
|
| |
+ @@ -256,7 +256,7 @@ class AttachmentDownloader extends Downloader {
|
| |
allRecords
|
| |
.filter(r => !!r.attachment)
|
| |
.map(r =>
|
| |
@@ -792,16 +810,16 @@
|
| |
)
|
| |
);
|
| |
}
|
| |
- @@ -975,7 +975,7 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
+ @@ -1092,7 +1092,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 {
|
| |
+ @@ -1114,7 +1114,7 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
// _importJSONDump() only clears DB if dump is available,
|
| |
// therefore do it here!
|
| |
if (imported < 0) {
|
| |
@@ -810,7 +828,7 @@
|
| |
}
|
| |
}
|
| |
}
|
| |
- @@ -1037,6 +1037,12 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
+ @@ -1154,6 +1154,12 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
return syncResult;
|
| |
}
|
| |
|
| |
@@ -824,10 +842,10 @@
|
| |
* Fetch information from changeset endpoint.
|
| |
*
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 00e45ee5b33b5e6030fa2d3b589cce5418822a3e Mon Sep 17 00:00:00 2001
|
| |
+ From 3ef189a633dfbe5a95cf5b290808b0003e8ba5c1 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 +860,16 @@
|
| |
1 file changed, 5 deletions(-)
|
| |
|
| |
diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/RemoteSettingsClient.jsm
|
| |
- index c20ce412b2..79ec40ee9e 100644
|
| |
+ index e102c8b89d..9cb3455aaf 100644
|
| |
--- a/services/settings/RemoteSettingsClient.jsm
|
| |
+++ b/services/settings/RemoteSettingsClient.jsm
|
| |
- @@ -917,14 +917,9 @@ class RemoteSettingsClient extends EventEmitter {
|
| |
+ @@ -1034,14 +1034,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 +879,20 @@
|
| |
await this.db.importChanges(metadata, remoteTimestamp, remoteRecords, {
|
| |
clear: retry,
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 37d74c55d8c1d852666f179fe6ea45fd99ff83ca Mon Sep 17 00:00:00 2001
|
| |
+ From 3d8d5ef12ab1c06cff841a9cca15a575750fc48d 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 00bf059d55..979e22c06a 100644
|
| |
--- a/services/settings/Attachments.jsm
|
| |
+++ b/services/settings/Attachments.jsm
|
| |
@@ -151,9 +151,10 @@ class Downloader {
|
| |
@@ -915,7 +933,7 @@
|
| |
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 +952,9 @@
|
| |
- 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 +971,10 @@
|
| |
|
| |
/**
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
|
| |
- From 5f475d79389de681e2eac63527a6d497b0b0da77 Mon Sep 17 00:00:00 2001
|
| |
+ From 0ba5c3f95dd3c8a468d49c73b5067bd78deb1442 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 +999,10 @@
|
| |
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 192915c16f..307f983896 100644
|
| |
--- a/modules/libpref/init/StaticPrefList.yaml
|
| |
+++ b/modules/libpref/init/StaticPrefList.yaml
|
| |
- @@ -12269,7 +12269,7 @@
|
| |
+ @@ -12540,7 +12540,7 @@
|
| |
# 3: Consult CRLite and enforce "Not Revoked" results, but defer to OCSP for "Revoked".
|
| |
- name: security.pki.crlite_mode
|
| |
type: RelaxedAtomicUint32
|
| |
@@ -992,10 +1012,10 @@
|
| |
|
| |
- name: security.tls.version.min
|
| |
diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp
|
| |
- index 12da07c56f..39f85cf5b3 100644
|
| |
+ index aab4319651..f21432a7e3 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 +1024,5 @@
|
| |
case CRLiteMode::Disabled:
|
| |
case CRLiteMode::TelemetryOnly:
|
| |
--
|
| |
- 2.37.0
|
| |
+ 2.37.2
|
| |
|
| |
Tested on x86_64. Included the WebRTC patch from Arch which fixes an issue on some systems using Wayland. Testing may be needed to find new freedom issues introduced, but I've yet to notice any.