Closed Bug 608316 Opened 14 years ago Closed 14 years ago

Cancelling an uninstall while onUninstalling events are still being sent can leave the UI confused

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla2.0b8
Tracking Status
blocking2.0 --- final+

People

(Reporter: mossop, Assigned: mossop)

Details

Attachments

(1 file)

If during an onUninstalling event for an add-on a listener calls cancelUninstall then the onOperationCancelled events get sent out followed by any remaining onUninstalling events for listeners. This can mean that the UI receives its onUninstalling event after the uninstall has cancelled and currently that makes it still display the add-on as waiting to be uninstalled. It also means it attempts to uninstall it again when the add-ons manager is closed or switched views (because it is confused over having an add-on in the list that is displayed as waiting to be uninstalled but isn't PENDING_UNINSTALL).

The simple fix is just to updateState in onUninstalling rather than assuming that the add-on is now pending uninstall.

The more complex fix would be to defer the onOperationCancelled event until after all listeners have seen the onUninstalling event but I'm pretty wary of making a change like that at this point.
blocking2.0: --- → final+
Attached patch patch rev 1Splinter Review
This is the simple fix, makes things nice and consistent too. It turns out nothing uses the restartrequired attribute anymore so I just removed all references to that too.
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Attachment #486969 - Flags: review?(bmcbride)
Whiteboard: [has patch][needs review Unfocused]
Attachment #486969 - Flags: review?(bmcbride) → review+
Landed: http://hg.mozilla.org/mozilla-central/rev/d809bf97ce08
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Flags: in-litmus-
Resolution: --- → FIXED
Whiteboard: [has patch][needs review Unfocused]
Target Milestone: --- → mozilla2.0b8
Hard to manually test. I trust the automated tests we have for this patch. Marking as verified fixed based on no reported test failures.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: