Remove needsUpdate asrouter targeting prop (was: asrouter shouldn't do a forced (foreground) update check)
Categories
(Firefox :: Messaging System, defect, P2)
Tracking
()
People
(Reporter: jcristau, Assigned: pdahiya)
References
(Blocks 1 open bug)
Details
https://searchfox.org/mozilla-central/rev/3966e5534ddf922b186af4777051d579fd052bad/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs#280 calls checkForUpdates with FOREGROUND_CHECK, which seems wrong since that is meant to be used when the user actively checks for update (i.e. opens the about dialog, essentially).
| Assignee | ||
Comment 1•1 year ago
|
||
needsUpdate got added in Fx65 and hasn't been in use for a while. FOREGROUND_CHECK in checkforUpdates got added as part of refactor with
https://phabricator.services.mozilla.com/D159295
| Reporter | ||
Comment 2•1 year ago
|
||
D159295 (bug 1727820) just changed checkForUpdates(updateServiceListener, /*force*/ true) to checkForUpdates(lazy.UpdateCheckSvc.FOREGROUND_CHECK). The code was already doing a foreground check since its addition in bug 1499886 AFAICT.
Comment 3•1 year ago
|
||
Based on this conversation and bug 1775138 I am nervous that we're evaluating this periodically from the background task code, and thus doing update checks with FOREGROUND_CHECK from that code. Nick has graciously agreed to do some initial poking to see if this understanding is correct, as that would (in the words of several of us on that thread) be both bad and unexpected.
Comment 4•1 year ago
|
||
:nalexander and I were chatting about this this today and I offered to update this bug since I could pretty immediately provide the answer here. Obviously this does do a foreground update check, yes. But it only does an update check.
For some background, there are basically two ways to control UpdateService:
- Call into
checkForBackgroundUpdates()(ornotify(), which is basically the same thing), here. This basically kicks off the entire update process. In other words,UpdateServicepushes the update process forwards. - "Manually" push the update process forwards (or have
AppUpdaterdo it for you).
The UpdateCheckSvc.checkForUpdates call in ASRouter is part of method (2). If you wanted the update process to actually continue after this update check, you'd have to do what AppUpdater does and call selectUpdate (here) and then downloadUpdate (here).
Since ASRouter doesn't make those calls, it isn't going to download any updates.
Comment 5•1 year ago
|
||
(In reply to Robin Steuber (she/her) [:bytesized] from comment #4)
Since ASRouter doesn't make those calls, it isn't going to download any updates.
Thanks for the clarification!
What happens with the result from the ASRouter check, the next time that the background/notify calls (1) runs? Does the result get used/reused, or do we re-fetch the information? (Does the answer change if the result from the ASRouter check was "there is an update" and the result from the background check is "no update" ?)
Comment 6•1 year ago
|
||
(In reply to :Gijs (he/him) from comment #5)
What happens with the result from the ASRouter check, the next time that the background/notify calls (1) runs? Does the result get used/reused, or do we re-fetch the information?
The update checking service only returns the result to the caller. It does not cache it anywhere.
(Does the answer change if the result from the ASRouter check was "there is an update" and the result from the background check is "no update" ?)
No.
Updated•1 year ago
|
Comment 7•1 year ago
|
||
I'm a bit surprised to see someone assigned to this since I'm confused as to what we want to change here and why. Is it to have ASRouter do a background check instead of a foreground check? That seems like a bit of a poor idea since it makes it somewhat non-deterministic as to whether the messaging system thinks there is an update available or not. The update server, Balrog, typically chooses a random number to decide if the main update mapping or the fallback update mapping is used. If the browser is already running the version offered as the fallback update, whether or not the messaging system says there is an update available is dependent on the result of that random value. That seems undesirable to me.
Am I understanding change that is planned correctly? If so, are we really okay with having this value be non-deterministic?
| Assignee | ||
Comment 8•1 year ago
|
||
@bytesized this bug can be repurposed to remove needsUpdate targeting which isn't in use for last 6 years, this will help reduce cost of maintaining this code
In addition we should audit as part of this or a separate bug what all targetings a) shouldn't be eagerly evaluated b) Filter those out from targeting snapshot exposed to Background Updater.
Updated•1 year ago
|
Comment 9•1 year ago
|
||
(In reply to Punam Dahiya [:pdahiya] from comment #8)
In addition we should audit as part of this or a separate bug what all targetings a) shouldn't be eagerly evaluated b) Filter those out from targeting snapshot exposed to Background Updater.
A separate bug would probably make sense. Can you link it here once filed? Thank you!
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 10•1 year ago
|
||
Filed targeting audit as a separate bug 1924253 thanks!
Updated•1 year ago
|
Comment 11•1 year ago
|
||
The severity field is not set for this bug.
:mviar, could you have a look please?
For more information, please visit BugBot documentation.
Updated•1 year ago
|
Description
•