Serialize/snapshot ASRouterTargeting configuration from browsing profiles for use by background task profiles
Categories
(Toolkit :: Background Tasks, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: nalexander, Assigned: nalexander)
References
(Blocks 5 open bugs)
Details
(Whiteboard: [fidedi-notifications])
Attachments
(3 files, 1 obsolete file)
This ticket tracks mirroring ASRouter targeting configuration from browsing profiles to background task profiles (whether ephemeral or persistent). There's no amazing way to achieve this (that I am aware of); I propose to serialize current targeting information as JSON to disk periodically, since the existing system does not track changes to the targeting configuration in a fine-grained manner. See ASRouterTargeting.jsm
. This balances freshness with performance -- both when querying the system (which is slow and is currently cached) and when writing to disk. In addition, we'd like to serialize as the browser exits -- but again, this impacts performance.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
The plan for this ticket is for regular browsing profiles to serialize
their targeting state to JSON on disk. The targeting state will,
ideally, be serialized at start up, periodically during browsing, and
at shutdown. However, everything done here must balance the
performance costs of the (sometimes non-trivial) queries and the cost
of recurring disk I/O.
A background task wishing to target based on browsing profile
configuration may then consume the targeting state serialized by the
default browsing profile, in much the same way that background tasks
read prefs and the legacy telemetry client ID from the default
browsing profile.
But for now, we ignore targeting and just make the existing code
background task-aware for testing.
Depends on D150521
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
This commit arranges to write targeting.snapshot.json
to the local
profile directory every 30 minutes, and just before shutdown. For
simplicity, it uses the existing JSONFile.jsm
implementation.
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
We take a simple approach:
- We add a test to verify that all getters succeed in background
task mode (save for an exclusion list of getters that access
non-local hosts). - We make certain getters background task-aware: for example,
because they require theAddonsManager
or legacy Telemetry.
This will allow background tasks to access their own targeting as well
as a snapshot of the default profile's targeting.
Depends on D151057
Assignee | ||
Comment 4•2 years ago
|
||
The default browsing profile's targeting snapshot is read using the
standard BackgroundTasksUtils.jsm
helpers, which allow setting the
profile location for testing.
The targeting snapshot is provided in the triggering context under
defaultProfile
, allowing both the background task profile's
targeting (for things like current Firefox version and currentDate
)
and the default browsing profile's targeting (for things like the
snapshot's currentDate
and add-ons).
Depends on D151089
Pushed by nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/71f5e50dc203 Part 1: Snapshot Firefox Messaging System targeting configuration periodically. r=barret https://hg.mozilla.org/integration/autoland/rev/f6a5a7695418 Part 2: Ensure `ASRouterTargeting.Environment` can be used in background tasks. r=barret https://hg.mozilla.org/integration/autoland/rev/83349b145d63 Part 3: Consume default profile Firefox Messaging System targeting in background tasks. r=barret
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/71f5e50dc203
https://hg.mozilla.org/mozilla-central/rev/f6a5a7695418
https://hg.mozilla.org/mozilla-central/rev/83349b145d63
Updated•2 years ago
|
Description
•