Closed Bug 1694515 Opened 2 months ago Closed 1 month ago

Add background task utilities for locking and reading prefs and other data from particular profiles


(Toolkit :: Application Update, enhancement)




88 Branch
Tracking Status
firefox88 --- fixed


(Reporter: nalexander, Assigned: nalexander)


(Blocks 1 open bug)



(4 files)

The --backgroundtask ... machinery of Bug 1667276 always runs in a temporary profile (created and destroyed per task invocation). Some configuration for tasks can be moved to per-installation prefs (see Bug 1691486 and friends) but some tasks want to read data of various shapes from other profiles (most notably, the default profile). This ticket tracks adding some utilities for these use cases.

:Mossop sketched some of this work over in We want to lock and unlock foreign profiles, fetch data files from them (e.g., the datareporting state for the client ID), and parse prefs.

Blocks: 1687777

NI to me to explain what the existing WIP I have is, and what the APIs that I'd like for this, so that somebody else can pick it up.

Flags: needinfo?(nalexander)

This provides a simple API for parsing prefs from given bytes. It's
important to not encode bytes as strings, since libpref is the
source of truth handling character encodings. In particular, prefs
files are not necessarily UTF-8.

This API allows to read prefs.js from another profile directory, for

Assignee: nobody → nalexander

This will be used from the backgroundupdate task to fish the default
profile's Telemetry client ID in order to correlate the task's Glean
ping with regular main pings.

Depends on D107711

Clearing NI since this is almost ready to land.

Flags: needinfo?(nalexander)
Blocks: 1697990
Pushed by
Pre: Extract `setupProfileService` test helper. r=bytesized
Part 1: Allow to parse prefs from data. r=KrisWright
Part 2: Add BackgroundTasksUtils module for locking profiles and reading prefs. r=bytesized,mossop
Part 3: Add BackgroundTasksUtils method for reading Telemetry client ID. r=bytesized,chutten
Blocks: 1704146
You need to log in before you can comment on or make changes to this bug.