Closed
Bug 557849
Opened 15 years ago
Closed 15 years ago
Make Addon.updateAutomatically persist
Categories
(Toolkit :: Add-ons Manager, defect, P1)
Toolkit
Add-ons Manager
Tracking
()
VERIFIED
FIXED
mozilla1.9.3a5
People
(Reporter: mossop, Assigned: mossop)
References
Details
(Whiteboard: [rewrite])
Attachments
(2 files)
19.89 KB,
patch
|
robert.strong.bugs
:
review+
|
Details | Diff | Splinter Review |
2.08 KB,
patch
|
robert.strong.bugs
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Comment 1•15 years ago
|
||
Is that the global preference to allow automatic updates?
Anything we should test manually on that end?
Flags: in-testsuite?
Flags: in-litmus?
Assignee | ||
Comment 2•15 years ago
|
||
This is the per-add-on way to opt-out of automatic updates. It's probably easiest for the background part of this functionality to be tested with an automated test, but we'll probably need some litmus coverage once the UI for checking for updates is finalised.
Assignee | ||
Comment 3•15 years ago
|
||
This makes the updateAutomatically property persist into the database and adds tests that it remains the same across add-on updates and makes the background update check only install updates when allowed to.
Attachment #439460 -
Flags: review?(robert.bugzilla)
Assignee | ||
Comment 4•15 years ago
|
||
Landed on branch: http://hg.mozilla.org/projects/addonsmgr/rev/6bc12660bce0
Flags: in-testsuite? → in-testsuite+
Whiteboard: [rewrite] → [rewrite][fixed-in-addonsmgr][needs-review]
![]() |
||
Comment 5•15 years ago
|
||
Comment on attachment 439460 [details] [diff] [review]
patch rev 1
>diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm
>--- a/toolkit/mozapps/extensions/AddonManager.jsm
>+++ b/toolkit/mozapps/extensions/AddonManager.jsm
>@@ -272,25 +272,30 @@ var AddonManagerInternal = {
> backgroundUpdateCheck: function AMI_backgroundUpdateCheck() {
> if (!Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED))
> return;
>
> let scope = {};
> Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", scope);
> scope.LightweightThemeManager.updateCurrentTheme();
>
>- this.getAddonsByTypes(null, function getAddonsCallback(aAddons) {
>+ this.getAllAddons(function getAddonsCallback(aAddons) {
> aAddons.forEach(function BUC_forEachCallback(aAddon) {
>- if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE) {
>- aAddon.findUpdates({
>- onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) {
>+ // Search for updates for all add-ons to allow compatibility information
>+ // to apply
Is this what you really mean here? Do you mean that this will check all add-ons for updates and if there is updated compatibility info it will also be applied? I don't suggest that wording but something along those lines if that is what you mean.
>+ aAddon.findUpdates({
>+ onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) {
>+ // Start installing updates when the add-on can be updated and
>+ // automatic updates are enabled.
>+ if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE &&
>+ aAddon.updateAutomatically) {
nit: I think updateAutomatically is better named as autoUpdate. What do you think?
Assignee | ||
Comment 6•15 years ago
|
||
(In reply to comment #5)
> (From update of attachment 439460 [details] [diff] [review])
> >diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm
> >--- a/toolkit/mozapps/extensions/AddonManager.jsm
> >+++ b/toolkit/mozapps/extensions/AddonManager.jsm
> >@@ -272,25 +272,30 @@ var AddonManagerInternal = {
> > backgroundUpdateCheck: function AMI_backgroundUpdateCheck() {
> > if (!Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED))
> > return;
> >
> > let scope = {};
> > Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", scope);
> > scope.LightweightThemeManager.updateCurrentTheme();
> >
> >- this.getAddonsByTypes(null, function getAddonsCallback(aAddons) {
> >+ this.getAllAddons(function getAddonsCallback(aAddons) {
> > aAddons.forEach(function BUC_forEachCallback(aAddon) {
> >- if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE) {
> >- aAddon.findUpdates({
> >- onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) {
> >+ // Search for updates for all add-ons to allow compatibility information
> >+ // to apply
> Is this what you really mean here? Do you mean that this will check all add-ons
> for updates and if there is updated compatibility info it will also be applied?
> I don't suggest that wording but something along those lines if that is what
> you mean.
Basically "Check all add-ons for updates so that any compatibility updates will be applied"
>
> >+ aAddon.findUpdates({
> >+ onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) {
> >+ // Start installing updates when the add-on can be updated and
> >+ // automatic updates are enabled.
> >+ if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE &&
> >+ aAddon.updateAutomatically) {
> nit: I think updateAutomatically is better named as autoUpdate. What do you
> think?
I'm not sure there is much between the two apart from length. I guess neither truly conveys what this setting is doing but for that we'd need something like applyAutomaticallyDetectedUpdates.
Assignee | ||
Comment 7•15 years ago
|
||
There is a follow up fix here for the test which I accidentally made intermittent.
Attachment #439645 -
Flags: review?(robert.bugzilla)
![]() |
||
Comment 8•15 years ago
|
||
(In reply to comment #6)
> (In reply to comment #5)
> > (From update of attachment 439460 [details] [diff] [review] [details])
>...
> > >+ aAddon.findUpdates({
> > >+ onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) {
> > >+ // Start installing updates when the add-on can be updated and
> > >+ // automatic updates are enabled.
> > >+ if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE &&
> > >+ aAddon.updateAutomatically) {
> > nit: I think updateAutomatically is better named as autoUpdate. What do you
> > think?
>
> I'm not sure there is much between the two apart from length. I guess neither
> truly conveys what this setting is doing but for that we'd need something like
> applyAutomaticallyDetectedUpdates.
As suggested in person how about applyBackgroundUpdates
![]() |
||
Comment 9•15 years ago
|
||
Comment on attachment 439460 [details] [diff] [review]
patch rev 1
Looks good! r=me with nits fixed
Attachment #439460 -
Flags: review?(robert.bugzilla) → review+
![]() |
||
Comment 10•15 years ago
|
||
Comment on attachment 439645 [details] [diff] [review]
follow up fix
Looks good and thanks for the walkthrough of the changes
Attachment #439645 -
Flags: review?(robert.bugzilla) → review+
![]() |
||
Updated•15 years ago
|
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-review] → [rewrite][fixed-in-addonsmgr]
Assignee | ||
Updated•15 years ago
|
Whiteboard: [rewrite][fixed-in-addonsmgr] → [rewrite][fixed-in-addonsmgr][needs-landing]
Assignee | ||
Comment 11•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [rewrite][fixed-in-addonsmgr][needs-landing] → [rewrite]
Target Milestone: --- → mozilla1.9.3a5
Comment 12•15 years ago
|
||
That slipped through. Verified fixed with Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b2) Gecko/20100720 Firefox/4.0b2
Status: RESOLVED → VERIFIED
Updated•14 years ago
|
Flags: in-litmus? → in-litmus?(vlad.maniac)
Comment 13•14 years ago
|
||
Litmus test has been added:
https://litmus.mozilla.org/show_test.cgi?id=15178
Flags: in-litmus?(vlad.maniac) → in-litmus+
You need to log in
before you can comment on or make changes to this bug.
Description
•