Closed Bug 1694515 Opened 4 years ago Closed 4 years ago

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

Categories

(Toolkit :: Background Tasks, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: nalexander, Assigned: nalexander)

References

(Blocks 1 open bug)

Details

Attachments

(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 https://phabricator.services.mozilla.com/D95060. 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.

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
example.

Assignee: nobody → nalexander
Status: NEW → ASSIGNED

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)
Pushed by nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8807a843f18c Pre: Extract `setupProfileService` test helper. r=bytesized https://hg.mozilla.org/integration/autoland/rev/4c171818b968 Part 1: Allow to parse prefs from data. r=KrisWright https://hg.mozilla.org/integration/autoland/rev/17fbd43adba9 Part 2: Add BackgroundTasksUtils module for locking profiles and reading prefs. r=bytesized,mossop https://hg.mozilla.org/integration/autoland/rev/416721045363 Part 3: Add BackgroundTasksUtils method for reading Telemetry client ID. r=bytesized,chutten
Component: Application Update → Background Tasks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: