summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrizzlyuser <grizzlyuser@protonmail.com>2022-05-31 19:15:34 +0200
committerbill-auger <mr.j.spam.me@gmail.com>2022-06-16 17:06:29 -0400
commitc909aeba6ae5f93d9e510c883cf8ea6a32400c74 (patch)
treebf24b0ea68b5ee3f75c6563f6600c5f757f3565b
parent70a84204e3443c648cfa8dabab23663361c69469 (diff)
libre/iceweasel: 101.0, upstream changes
-rw-r--r--libre/iceweasel/9001-FSDG-sync-remote-settings-with-local-dump.patch41
-rw-r--r--libre/iceweasel/9004-FSDG-misc.patch22
-rw-r--r--libre/iceweasel/PKGBUILD10
-rw-r--r--libre/iceweasel/process-json-files.py22
4 files changed, 50 insertions, 45 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 e1da46760..c46d90f51 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
@@ -85,7 +85,7 @@ index f91e5dcb67..c09c58e693 100644
},
- CHANGES_PATH: "/buckets/monitor/collections/changes/changeset",
-+ CHANGES_PATH: "/monitor/changes.json",
++ CHANGES_PATH: "/monitor/changes",
/**
* Logger instance.
@@ -280,7 +280,7 @@ Date: Wed, 30 Dec 2020 17:47:41 +0200
Subject: [PATCH 04/13] Utils: fetch timestamps of each collection locally
Utils.CHANGES_PATH points to
-services/settings/dumps/monitor/changes.json
+services/settings/dumps/monitor/changes
which will be generated later by JSON processing script. Fetch the
timestamps from that file and mock response headers to not confuse any
code that expects them.
@@ -317,7 +317,7 @@ index c09c58e693..f5605b1b16 100644
const params = {
...filters,
_expected: expectedTimestamp ?? 0,
-@@ -315,7 +315,10 @@ var Utils = {
+@@ -315,7 +315,11 @@ var Utils = {
.map(([k, v]) => `${k}=${encodeURIComponent(v)}`)
.join("&");
}
@@ -326,6 +326,7 @@ index c09c58e693..f5605b1b16 100644
+ const responseDate = new Date().toUTCString()
+ response.headers.set("Date", responseDate);
+ response.headers.set("Last-Modified", responseDate);
++ response.headers.set("Content-Type", "application/json");
if (response.status >= 500) {
throw new Error(`Server error ${response.status} ${response.statusText}`);
@@ -356,7 +357,7 @@ index 0000000000..d3d017fda5
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
-+FINAL_TARGET_FILES.defaults.settings.monitor += ["changes.json"]
++FINAL_TARGET_FILES.defaults.settings.monitor += ["changes"]
+
+if CONFIG["MOZ_BUILD_APP"] == "browser":
+ DIST_SUBDIR = "browser"
@@ -782,18 +783,15 @@ diff --git a/services/settings/RemoteSettingsClient.jsm b/services/settings/Remo
index 64ac27d149..ac6259ca2c 100644
--- a/services/settings/RemoteSettingsClient.jsm
+++ b/services/settings/RemoteSettingsClient.jsm
-@@ -219,7 +219,10 @@ class AttachmentDownloader extends Downloader {
- async deleteAll() {
- let allRecords = await this._client.db.list();
- return Promise.all(
-- allRecords.filter(r => !!r.attachment).map(r => this.delete(r))
-+ allRecords.filter(r => !!r.attachment).map(r => {
-+ this.delete(r);
-+ this.deleteCached(r.id);
-+ })
+@@ -219,7 +219,7 @@ class AttachmentDownloader extends Downloader {
+ allRecords
+ .filter(r => !!r.attachment)
+ .map(r =>
+- Promise.all([this.deleteDownloaded(r), this.deleteFromDisk(r)])
++ Promise.all([this.deleteDownloaded(r), this.deleteFromDisk(r), this.deleteCached(r.id)])
+ )
);
}
- }
@@ -1013,7 +1016,7 @@ class RemoteSettingsClient extends EventEmitter {
// Signature failed, clear local DB because it contains
// bad data (local + remote changes).
@@ -879,19 +877,18 @@ diff --git a/services/settings/Attachments.jsm b/services/settings/Attachments.j
index 70c02627ac..d24d8907fd 100644
--- a/services/settings/Attachments.jsm
+++ b/services/settings/Attachments.jsm
-@@ -141,10 +141,11 @@ class Downloader {
+@@ -151,9 +151,10 @@ class Downloader {
+ retries,
checkHash,
attachmentId = record?.id,
- useCache = false,
- fallbackToCache = false,
fallbackToDump = false,
} = options || {};
-
+ const fallbackToCache = false;
-+
- if (!useCache) {
- // For backwards compatibility.
- // WARNING: Its return type is different from what's documented.
++
+ if (!attachmentId) {
+ // Check for pre-condition. This should not happen, but it is explicitly
+ // checked to avoid mixing up attachments, which could be dangerous.
@@ -204,6 +205,7 @@ class Downloader {
const newBuffer = await this.downloadAsBytes(record, {
retries,
@@ -899,7 +896,7 @@ index 70c02627ac..d24d8907fd 100644
+ dumpInfo,
});
const blob = new Blob([newBuffer]);
- if (useCache) {
+ // Store in cache but don't wait for it before returning.
@@ -239,7 +241,7 @@ class Downloader {
}
diff --git a/libre/iceweasel/9004-FSDG-misc.patch b/libre/iceweasel/9004-FSDG-misc.patch
index 72981fb63..c45b97eb0 100644
--- a/libre/iceweasel/9004-FSDG-misc.patch
+++ b/libre/iceweasel/9004-FSDG-misc.patch
@@ -355,15 +355,16 @@ index 44d36d3b28..6823855d56 100644
// These app marketplace icons are referenced based on the user's locale
// in browser/components/newtab/content-src/aboutwelcome/components/MobileDownloads.jsx
diff --git a/browser/components/newtab/lib/OnboardingMessageProvider.jsm b/browser/components/newtab/lib/OnboardingMessageProvider.jsm
-index dab8a0ec19..81bedf523c 100644
+index 940332f27f..1f7378bbae 100644
--- a/browser/components/newtab/lib/OnboardingMessageProvider.jsm
+++ b/browser/components/newtab/lib/OnboardingMessageProvider.jsm
-@@ -95,221 +95,6 @@ const ONBOARDING_MESSAGES = () => [
+@@ -95,220 +95,6 @@ const ONBOARDING_MESSAGES = () => [
],
},
},
- {
- id: "PB_NEWTAB_FOCUS_PROMO",
+- type: "default",
- template: "pb_newtab",
- groups: ["pbNewtab"],
- content: {
@@ -390,12 +391,10 @@ index dab8a0ec19..81bedf523c 100644
- id: "FOCUS_PROMO",
- template: "multistage",
- modal: "tab",
-- metrics: "block",
- backdrop: "transparent",
- screens: [
- {
- id: "DEFAULT_MODAL_UI",
-- order: 0,
- content: {
- logo: {
- imageURL:
@@ -464,16 +463,17 @@ index dab8a0ec19..81bedf523c 100644
- frequency: {
- custom: [
- {
-- cap: 1,
-- period: 604800000, // Max 1 per week
+- cap: 3,
+- period: 604800000, // Max 3 per week
- },
- ],
-- lifetime: 3,
+- lifetime: 12,
- },
- targeting: "!(region in [ 'DE', 'AT', 'CH'] && localeLanguageCode == 'en')",
- },
- {
- id: "PB_NEWTAB_KLAR_PROMO",
+- type: "default",
- template: "pb_newtab",
- groups: ["pbNewtab"],
- content: {
@@ -501,7 +501,6 @@ index dab8a0ec19..81bedf523c 100644
- id: "KLAR_PROMO",
- template: "multistage",
- modal: "tab",
-- metrics: "block",
- backdrop: "transparent",
- screens: [
- {
@@ -569,17 +568,18 @@ index dab8a0ec19..81bedf523c 100644
- frequency: {
- custom: [
- {
-- cap: 1,
-- period: 604800000, // Max 1 per week
+- cap: 3,
+- period: 604800000, // Max 3 per week
- },
- ],
-- lifetime: 3,
+- lifetime: 12,
- },
- targeting: "region in [ 'DE', 'AT', 'CH'] && localeLanguageCode == 'en'",
- },
{
id: "PB_NEWTAB_INFO_SECTION",
template: "pb_newtab",
+
diff --git a/browser/components/newtab/lib/PanelTestProvider.jsm b/browser/components/newtab/lib/PanelTestProvider.jsm
index a991581f7b..af57c3eea8 100644
--- a/browser/components/newtab/lib/PanelTestProvider.jsm
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD
index d0b4b06d4..a20ebd04e 100644
--- a/libre/iceweasel/PKGBUILD
+++ b/libre/iceweasel/PKGBUILD
@@ -60,7 +60,7 @@
pkgname=iceweasel
epoch=1
-pkgver=100.0
+pkgver=101.0
pkgrel=1
pkgrel+=.parabola1
_brandingver=98.0-1
@@ -98,16 +98,16 @@ source_armv7h=(build-arm-libopus.patch)
source_i686=('avoid-libxul-OOM-python-check.patch'
'rust-static-disable-network-test-on-static-libraries.patch'
'firefox-99.0.1-fdlibm-double.patch')
-sha256sums=('664c0cc4e0fb70886aa4e652d144996045d533a18eebc7d61093103cbb2d5e7f'
+sha256sums=('55ab5b517d58bbcbc837640263a8371cf1fba3d9f508e54537c4d2cbbfb86095'
'SKIP'
'9cdc2602661717712092d28bb494e5b48e518cb930898aca85eaf21f91f7ef58')
sha256sums+=('f3e89499909b172476e931d9ab18b856d0001e3042b3816d1728809536179768'
'SKIP'
- '0bfffc020a5fba0895c40f79bd613c1e2504bf24239dfbc04474f6263fd0e834'
+ 'f49bb26d1a04145c39639200b64fd9010ded4261f60e06eb48bc0d5f58d1e935'
'a2c71759290dd48c87bf8aacb681040dcaefdabe0d57317de361d2d2d509664b'
'e192458a2a9878483984e1400bb3c66df369adfbf6f144b90445f80973c32ed1'
- '71c098c5b7d62babf2296d55d43a7bc9f2ca10da9ee77552f9afa01b78541522'
- '9386f1c50506cd20ab6d212335d5e4417faeb2aea371dd46f2d107d171e80b83'
+ 'a6a0bf8296d42a0ea2664efd45e9131df1f19fc6199724ec78d66119589850dd'
+ '6a0250c20a6f4cbf0ff1320c194342fe691ece56959d87de41be8f82a8feca65'
'c93ce98e1cb64033079343ff1f3037fab6a3bc6d3eb5bc14c5edb70e2d45965d')
sha256sums_armv7h=('2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9')
sha256sums_i686=('2f0c81a38c4578f68f5456b618fe84a78974072821488173eb55e0e72287e353'
diff --git a/libre/iceweasel/process-json-files.py b/libre/iceweasel/process-json-files.py
index 89e2960f5..faf2cd412 100644
--- a/libre/iceweasel/process-json-files.py
+++ b/libre/iceweasel/process-json-files.py
@@ -54,10 +54,18 @@ class RemoteSettings:
DUMPS_PATH_ABSOLUTE = arguments.MAIN_PATH / DUMPS_PATH_RELATIVE
_WRAPPER_NAME = 'data'
+ _LAST_MODIFIED_KEY_NAME = 'last_modified'
+
+ @classmethod
+ def get_collection_timestamp(cls, collection):
+ return max((record[cls._LAST_MODIFIED_KEY_NAME]
+ for record in collection.content), default=0)
@classmethod
def wrap(cls, processed):
- return File(processed.path, {cls._WRAPPER_NAME: processed.content})
+ return File(processed.path,
+ {cls._WRAPPER_NAME: processed.content,
+ 'timestamp': cls.get_collection_timestamp(processed)})
@classmethod
def unwrap(cls, parsed_jsons):
@@ -75,7 +83,6 @@ class RemoteSettings:
@classmethod
def process_raw(cls, unwrapped_jsons, parsed_schema):
timestamps, result = [], []
- last_modified_key_name = 'last_modified'
for collection in unwrapped_jsons:
should_modify_collection = cls.should_modify_collection(collection)
@@ -93,14 +100,15 @@ class RemoteSettings:
while timestamp in timestamps:
timestamp += 1
timestamps.append(timestamp)
- record[last_modified_key_name] = timestamp
+ record[cls._LAST_MODIFIED_KEY_NAME] = timestamp
if parsed_schema is not None:
validate(record, schema=parsed_schema)
result.append(record)
- result.sort(key=lambda record: record[last_modified_key_name], reverse=True)
+ result.sort(
+ key=lambda record: record[cls._LAST_MODIFIED_KEY_NAME], reverse=True)
cls.OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True)
return File(cls.OUTPUT_PATH, result)
@@ -115,7 +123,7 @@ class RemoteSettings:
class Changes(RemoteSettings):
JSON_PATHS = tuple(RemoteSettings.DUMPS_PATH_ABSOLUTE.glob('*/*.json'))
- OUTPUT_PATH = RemoteSettings.DUMPS_PATH_ABSOLUTE / 'monitor/changes.json'
+ OUTPUT_PATH = RemoteSettings.DUMPS_PATH_ABSOLUTE / 'monitor/changes'
@classmethod
def wrap(cls, processed):
@@ -130,8 +138,8 @@ class Changes(RemoteSettings):
for collection in unwrapped_jsons:
if collection.path != RemoteSettings.DUMPS_PATH_ABSOLUTE / 'main/example.json':
latest_change = {}
- latest_change['last_modified'] = max(
- (record['last_modified'] for record in collection.content), default=0)
+ latest_change[cls._LAST_MODIFIED_KEY_NAME] = cls.get_collection_timestamp(
+ collection)
latest_change['bucket'] = collection.path.parent.name
latest_change['collection'] = collection.path.stem
changes.append(latest_change)