Disable app updates when running out of an app package
Categories
(Firefox :: Installer, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox92 | --- | fixed |
People
(Reporter: molly, Assigned: molly)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
If we used our built-in updater when running as a package, it's difficult to fully mitigate the risk of prompting the user to install a manual update, and doing so would likely be a serious problem (they would probably no longer be using the same profile, for one thing). It's also possible that our updater might conflict with another instance not running from a package, because the update directories are not in one of the virtualized file system locations.
So, we should disable our update system when we are an app package, and rely on the one provided by whatever mechanism deployed the package instead. Since we know at runtime whether we are in a package or not, we can detect that state and behave as if update were disabled by policy. That way, we can be certain that everything we might want to avoid really does get disabled.
Assignee | ||
Comment 1•4 years ago
|
||
We'll also want to make sure that we don't end up having a "managed by your administrator" message showing up anywhere, since we're kind of piggybacking on the policy mechanism here.
Comment 2•4 years ago
|
||
Yeah, I've been thinking about this. Can we use the mechanism in policy to disable something (app updates), but the policy isn't technically running?
I think the answer is yes, but I need to do some tests.
Comment 3•4 years ago
|
||
Just wanted to throw out an idea. You could consolidate the existing instances of isAllowed("appUpate")
so they instead check UpdateService.disabledByPolicy
. Then you could check HasPackageIdentity()
in the implementation of UpdateService.disabledByPolicy
.
That way, no policy would actually be active, which would prevent problems with unexpected policy-related messages and conflicts with other policies.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
This patch disables the update service as if it were disabled by policy
whenever a package identify is present. User interfaces are treated as if
the updater had not been included in the build, because that prevents any of
our usual update UI from being shown, and in particular ensures that we do not
generate messages about an administrator handling updates, as would normally
happen when disabling updates via policy.
The telemetry environment's update.enabled flag is deliberately left alone in
this patch, because the mere fact of using an app package does not really say
anything about whether the user intends to allow automatic updating or not.
Comment 5•4 years ago
|
||
This bug might also come into play here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1710796
Is there a better thing to check in that patch so we cover both this and the policy case?
Assignee | ||
Comment 6•4 years ago
|
||
For the updated patch I just posted, I added a case for both this case and the policy to _setCurrentTipFromAppUpdaterStatus
, so that it won't select any tip to display. I like that marginally better because it only uses the status value that's being returned by AppUpdater.jsm
instead of trying to determine anything for itself (but that's a very fine distinction), and also that one change happens to not depend on any other Tikka work because I've had the existing NO_UPDATER
status get returned in the packaged app case.
Comment 7•3 years ago
|
||
I'm just making a note to myself here: this will disable the background update mechanism, because:
BackgroundUpdate.jsm
checks forcanUsuallyCheckForUpdates
canUsuallyCheckForUpdates
checks fordisabledByPolicy
- this patch makes
disabledByPolicy
check for an app package.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 9•3 years ago
|
||
Backed for causing failures on app update.
backout: https://hg.mozilla.org/integration/autoland/rev/4ea396abdadeae570a22cf638c6ec952a57848d9
failure log example: https://treeherder.mozilla.org/logviewer?job_id=345217080&repo=autoland&lineNumber=4472
[task 2021-07-14T19:14:00.336Z] 19:14:00 INFO - TEST-PASS | toolkit/components/normandy/test/browser/browser_about_preferences.js | Clicking the view studies link opens about:studies in a new tab. -
[task 2021-07-14T19:14:00.339Z] 19:14:00 INFO - Console message: [JavaScript Error: "[Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 692" data: no]"]
[task 2021-07-14T19:14:00.339Z] 19:14:00 INFO - L10nRegistry.loadSync@resource://gre/modules/L10nRegistry.jsm:692:19
[task 2021-07-14T19:14:00.339Z] 19:14:00 INFO - fetchFile@resource://gre/modules/L10nRegistry.jsm:607:31
[task 2021-07-14T19:14:00.339Z] 19:14:00 INFO - generateResourceSetSync/<@resource://gre/modules/L10nRegistry.jsm:512:19
[task 2021-07-14T19:14:00.339Z] 19:14:00 INFO - generateResourceSetSync@resource://gre/modules/L10nRegistry.jsm:507:22
[task 2021-07-14T19:14:00.339Z] 19:14:00 INFO - generateResourceSetsForLocaleSync@resource://gre/modules/L10nRegistry.jsm:449:44
[task 2021-07-14T19:14:00.339Z] 19:14:00 INFO - generateBundlesSync@resource://gre/modules/L10nRegistry.jsm:186:7
[task 2021-07-14T19:14:00.340Z] 19:14:00 INFO - touchNext@resource://gre/modules/Localization.jsm:167:37
[task 2021-07-14T19:14:00.340Z] 19:14:00 INFO - generateBundles@resource://gre/modules/Localization.jsm:473:15
[task 2021-07-14T19:14:00.340Z] 19:14:00 INFO - getLanguageDisplayNames@resource://gre/modules/mozIntl.jsm:788:19
[task 2021-07-14T19:14:00.340Z] 19:14:00 INFO - getLocaleDisplayNames/<@resource://gre/modules/mozIntl.jsm:866:14
[task 2021-07-14T19:14:00.340Z] 19:14:00 INFO - getLocaleDisplayNames@resource://gre/modules/mozIntl.jsm:845:24
[task 2021-07-14T19:14:00.340Z] 19:14:00 INFO - displayUseSystemLocale@chrome://browser/content/preferences/main.js:1427:43
[task 2021-07-14T19:14:00.341Z] 19:14:00 INFO - init@chrome://browser/content/preferences/main.js:370:10
[task 2021-07-14T19:14:00.341Z] 19:14:00 INFO - init@chrome://browser/content/preferences/preferences.js:105:22
[task 2021-07-14T19:14:00.341Z] 19:14:00 INFO -
[task 2021-07-14T19:14:00.347Z] 19:14:00 INFO - Console message: [JavaScript Error: "[Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIXPCComponents_Utils.readUTF8URI]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://gre/modules/L10nRegistry.jsm :: L10nRegistry.loadSync :: line 692" data: no]"]
[task 2021-07-14T19:14:00.347Z] 19:14:00 INFO - L10nRegistry.loadSync@resource://gre/modules/L10nRegistry.jsm:692:19
[task 2021-07-14T19:14:00.347Z] 19:14:00 INFO - fetchFile@resource://gre/modules/L10nRegistry.jsm:607:31
[task 2021-07-14T19:14:00.348Z] 19:14:00 INFO - generateResourceSetSync/<@resource://gre/modules/L10nRegistry.jsm:512:19
[task 2021-07-14T19:14:00.348Z] 19:14:00 INFO - generateResourceSetSync@resource://gre/modules/L10nRegistry.jsm:507:22
[task 2021-07-14T19:14:00.349Z] 19:14:00 INFO - generateResourceSetsForLocaleSync@resource://gre/modules/L10nRegistry.jsm:449:44
[task 2021-07-14T19:14:00.349Z] 19:14:00 INFO - generateBundlesSync@resource://gre/modules/L10nRegistry.jsm:186:7
[task 2021-07-14T19:14:00.349Z] 19:14:00 INFO - touchNext@resource://gre/modules/Localization.jsm:167:37
[task 2021-07-14T19:14:00.350Z] 19:14:00 INFO - generateBundles@resource://gre/modules/Localization.jsm:473:15
[task 2021-07-14T19:14:00.351Z] 19:14:00 INFO - getRegionDisplayNames@resource://gre/modules/mozIntl.jsm:815:19
[task 2021-07-14T19:14:00.351Z] 19:14:00 INFO - getLocaleDisplayNames/<@resource://gre/modules/mozIntl.jsm:875:16
[task 2021-07-14T19:14:00.352Z] 19:14:00 INFO - getLocaleDisplayNames@resource://gre/modules/mozIntl.jsm:845:24
[task 2021-07-14T19:14:00.352Z] 19:14:00 INFO - displayUseSystemLocale@chrome://browser/content/preferences/main.js:1427:43
[task 2021-07-14T19:14:00.353Z] 19:14:00 INFO - init@chrome://browser/content/preferences/main.js:370:10
[task 2021-07-14T19:14:00.353Z] 19:14:00 INFO - init@chrome://browser/content/preferences/preferences.js:105:22
[task 2021-07-14T19:14:00.354Z] 19:14:00 INFO -
[task 2021-07-14T19:14:00.355Z] 19:14:00 INFO - Buffered messages finished
[task 2021-07-14T19:14:00.355Z] 19:14:00 INFO - TEST-UNEXPECTED-FAIL | toolkit/components/normandy/test/browser/browser_about_preferences.js | A promise chain failed to handle a rejection: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPropertyBag2.getProperty] - stack: get updateDisabledByPackage@resource:///modules/AppUpdater.jsm:190:29
[task 2021-07-14T19:14:00.356Z] 19:14:00 INFO - check@resource:///modules/AppUpdater.jsm:63:9
[task 2021-07-14T19:14:00.356Z] 19:14:00 INFO - appUpdater@chrome://browser/content/aboutDialog-appUpdater.js:53:20
[task 2021-07-14T19:14:00.356Z] 19:14:00 INFO - init@chrome://browser/content/preferences/main.js:661:21
[task 2021-07-14T19:14:00.357Z] 19:14:00 INFO - init@chrome://browser/content/preferences/preferences.js:105:22
[task 2021-07-14T19:14:00.357Z] 19:14:00 INFO - Rejection date: Wed Jul 14 2021 19:13:59 GMT+0000 (Coordinated Universal Time) - false == true - JS frame :: resource://testing-common/PromiseTestUtils.jsm :: assertNoUncaughtRejections :: line 285
[task 2021-07-14T19:14:00.357Z] 19:14:00 INFO - Stack trace:
[task 2021-07-14T19:14:00.357Z] 19:14:00 INFO - resource://testing-common/PromiseTestUtils.jsm:assertNoUncaughtRejections:285
[task 2021-07-14T19:14:00.357Z] 19:14:00 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1112
[task 2021-07-14T19:14:00.358Z] 19:14:00 INFO - Leaving test bound testViewStudiesLink
[task 2021-07-14T19:14:00.358Z] 19:14:00 INFO - GECKO(2753) | JavaScript error: resource:///modules/AppUpdater.jsm, line 190: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPropertyBag2.getProperty]
[task 2021-07-14T19:14:00.358Z] 19:14:00 INFO - Console message: [JavaScript Error: "AbortError: Actor 'ShieldFrame' destroyed before query 'Shield:GetMessagingSystemList' was resolved"]
[task 2021-07-14T19:14:00.359Z] 19:14:00 INFO - Console message: [JavaScript Error: "AbortError: Actor 'ShieldFrame' destroyed before query 'Shield:GetPreferenceStudyList' was resolved"]
[task 2021-07-14T19:14:00.359Z] 19:14:00 INFO - Console message: [JavaScript Error: "AbortError: Actor 'ShieldFrame' destroyed before query 'Shield:GetStudiesEnabled' was resolved"]
[task 2021-07-14T19:14:00.359Z] 19:14:00 INFO - Console message: [JavaScript Error: "AbortError: Actor 'ShieldFrame' destroyed before query 'Shield:GetAddonStudyList' was resolved"]
[task 2021-07-14T19:14:00.360Z] 19:14:00 INFO - Console message: [JavaScript Error: "NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPropertyBag2.getProperty]" {file: "resource:///modules/AppUpdater.jsm" line: 190}]
[task 2021-07-14T19:14:00.360Z] 19:14:00 INFO - GECKO(2753) | MEMORY STAT | vsize 130551149MB | residentFast 1909MB
[task 2021-07-14T19:14:00.360Z] 19:14:00 INFO - TEST-OK | toolkit/components/normandy/test/browser/browser_about_preferences.js | took 30806ms
Assignee | ||
Comment 10•3 years ago
|
||
The problem appears to be that I didn't realize nsIPropertyBag
in JS throws if you get a property that isn't set; I thought it would return undefined. I'll update this patch to account for that.
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
bugherder |
Description
•