Ensure Remote Settings for granular overrides supports target filters
Categories
(Core :: Privacy: Anti-Tracking, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox139 | --- | fixed |
People
(Reporter: tjr, Assigned: fklc)
References
Details
Attachments
(1 external file)
We need to ensure that target filters work for the granular overrides Remote Settings bucket so we can write rules that target only certain versions of Firefox so we can e.g. disable a target for a certain Firefox version, but stop disabling it once we fix it.
| Assignee | ||
Comment 1•1 year ago
•
|
||
I tried running the following on both desktop and android and it works
const { RemoteSettings } = ChromeUtils.importESModule("resource://services-settings/remote-settings.sys.mjs")
const client = RemoteSettings("a-key");
FILTER_TO_TEST = `
env.version|versionCompare("110.0a1")
`;
(
async function () {
await client.db.clear();
await client.db.importChanges({}, 42);
const record = await client.db.create({
id: "68b19efa-1067-401b-b1c1-8d7b4263bb86", // random uuidgen
filter_expression: FILTER_TO_TEST
});
const filtered = await client.get();
console.log(filtered.length == 1);
}
)();
I also tried if we can filter by build ID, but it looks like it isn't possible. You can't do env.appinfo.platformBuildID > X, only string operations.
So if I understand it correctly, the answer is yes, we can use filter expressions. We just need to modify the schema to add filter_expression field, and add desired version checks. Do note though, we won't be able to target builds after a certain date.
| Reporter | ||
Comment 2•1 year ago
|
||
I'm not concerned about targeting specific buildids. This is intended for release where we would be targeting full releases (e.g. <=131.0 with one rule and > 131.0 with another).
just need to modify the schema to add filter_expression field, and add desired version checks aligns with what I thought we had to do, so that's good.
| Assignee | ||
Comment 3•1 year ago
|
||
Turns out just changing the table schema was not enough :) We also had to call .get instead of depending on raw data from sync event.
Comment 5•1 year ago
|
||
Backed out for BC failure on browser_fingerprintingRemoteOverrides.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/7ce8ccf67680fade60f32e7bb7e11d1f173e5f52
Log link: https://treeherder.mozilla.org/logviewer?job_id=502327364&repo=autoland&lineNumber=8407
Comment 8•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Description
•