Closed Bug 562599 Opened 14 years ago Closed 14 years ago

Add an event to notify that Addon.applyBackgroundUpdates has changed

Categories

(Toolkit :: Add-ons Manager, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla2.0b2
Tracking Status
blocking2.0 --- beta2+

People

(Reporter: Unfocused, Assigned: mossop)

References

Details

(Keywords: APIchange, Whiteboard: [rewrite])

Attachments

(1 file)

Currently, there's no way of listening for when addon.applyBackgroundUpdates changes. Would be great to have an event, either specific to this property, or a generic one that passes a list of what properties changed.
Flags: in-testsuite?
Blocks: 562622
blocking2.0: --- → ?
Priority: -- → P1
What do we lose by not having this Blair?
Without this, we can't guarantee the automatic updates checkbox for each addon is in sync (without constant polling, that is). Mostly important with multiple copies of about:addons open, but other things could potentially change it too (thinking extensions - like the Tor addon disabling automatic updates for itself). Not needed for beta 1, but its something I want to be able to do before final.

We could make this a miscellaneous catch-all event for other properties that don't have events either. addon.blocklistState comes to mind. Something like onPropertyChanged(aAddon, aProperty)
Ah yeah I hadn't thought about the multiple tabs case much, makes sense.
blocking2.0: ? → final+
blocking2.0: final+ → beta2+
Whiteboard: [rewrite] → [rewrite][apichange]
Keywords: APIchange
Whiteboard: [rewrite][apichange] → [rewrite]
Assignee: nobody → dtownsend
Attached patch patch rev 1Splinter Review
Added as a generic property changed event that may be useful for other things in the future.

The event is passed an array of property names that may have changed so we can dispatch a single event for multiple changes. Receivers should not assume that the named properties have actually changed since we may just want to dispatch this after some update method may or may not have made changes.
Attachment #455784 - Flags: review?(robert.bugzilla)
Status: NEW → ASSIGNED
Attachment #455784 - Flags: review?(robert.bugzilla) → review+
http://hg.mozilla.org/mozilla-central/rev/d8c1051908ad
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3b2
I would tend to say it should only be an automated test.
Flags: in-litmus-
Version: unspecified → Trunk
Verified fixed based on check-in and passing tests.
Status: RESOLVED → VERIFIED
(In reply to comment #4)
> Receivers should not assume that
> the named properties have actually changed since we may just want to dispatch
> this after some update method may or may not have made changes.

Just as a for-the-record followup: Discussed this with Dave, and its best if consumers can rely on onPropertyChanged meaning that properties did in fact change. 

So the API *will* guarantee that properties changed, and consumers *can assume* that the properties changed. This was already the case for applyBackgroundUpdates, but any use of onPropertyChanged in the future will also need to guarantee this.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: