Closed Bug 1689519 Opened 3 years ago Closed 3 years ago

Add `--backgroundtask backgroundupdate` implementation

Categories

(Toolkit :: Application Update, task)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: nalexander, Assigned: nalexander)

References

(Blocks 3 open bugs)

Details

Attachments

(6 files, 1 obsolete file)

This ticket tracks adding a Gecko-based background task using the framework of Bug 1667276 that pumps UpdateService.jsm.

The AppUpdater module invokes a callback with updater status codes.
The callback can be invoked multiple times with different codes
throughout the lifecycle of an update (check). This helper captures
the codes that are terminal, meaning that the update (check) has
completed. It also includes a tiny helper to determine a string
representation of a status code for logging.

Assignee: nobody → nalexander
Status: NEW → ASSIGNED

This background task checks various eligibility criteria and then
pumps the App Update Service update loop.

For convenience, it uses the existing browser-only AppUpdater.jsm.
There's nothing truly browser-specific here, though; in the future, we
could support other applications (namely, Thunderbird).

Depends on D104637

Depends on: 1691486, 1483399
Depends on: 1694515
Depends on: 1695797
Blocks: 1696276
Depends on: 1687781
Depends on: 1697875
No longer blocks: 1696276
Depends on: 1696276
Depends on: 1698169

There was some subtle logic around counting installs and our own path
(remember, this can be used from an unarchived package that itself was
not installed from the Windows installer) that I didn't care to keep;
this does the simplest possible thing instead.

Depends on D108661

The canUsuallyX variants do not take into account transient factors.
The set of transient factors may evolve over time, so we don't list
them exhaustively, but they may include:

  1. Whether this instance has the update mutext (on Windows);
  2. Whether other instances are running.

The intended consumer of these variants is the background update task
machinery, which wants to schedule tasks when they are likely to
usually succeed, even if they might not succeed right now.

Depends on D108701

Summary: Add background update background task → Add `--backgroundtask backgroundupdate` implementation
Depends on: 1700156
Depends on: 1700158
Attachment #9209506 - Attachment is obsolete: true

My immediate use case is making the name for a Windows Scheduled Tasks
agree with the existing task names for the Windows Default Browser
Agent task name. The latter uses MOZ_APP_DISPLAYNAME in its static
metadata and from C++.

We want to strongly discourage users from using MOZ_APP_DISPLAYNAME
in dynamic contexts, hence the unusual name and long comment; but it's
not worth establishing a lint limiting uses at this time.

Depends on: 1700236
Depends on: 1700846
Blocks: 1700850
Depends on: 1700987
Pushed by nalexander@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/673745818480
Pre: Add BackgroundTasksManager.EXIT_CODE. r=bytesized
https://hg.mozilla.org/integration/autoland/rev/94fcfdd28dbd
Pre: Assume user can't elevate in background task mode. r=bytesized
https://hg.mozilla.org/integration/autoland/rev/587a4c4aa10d
Pre: Separate `canX` from `canUsuallyX` in Update Service. r=bytesized
https://hg.mozilla.org/integration/autoland/rev/cd5b5cc01886
Pre: Add AppUpdater.jsm helpers: terminal predicate, debug string. r=adw,bytesized
https://hg.mozilla.org/integration/autoland/rev/06ddd32322a9
Pre: Expose `MOZ_APP_DISPLAYNAME_DO_NOT_USE` in AppConstants. r=glandium,Kwan
https://hg.mozilla.org/integration/autoland/rev/7d67c1219118
Add `--backgroundtask backgroundupdate`. r=bytesized
Blocks: 1703302
Blocks: 1703318
Regressions: 1703732
Regressions: 1703877
Blocks: 1704855
Depends on: 1737117
Blocks: 1794051
Blocks: 1795467
Blocks: 1795471
Blocks: 1833735
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: