Closed Bug 834292 Opened 12 years ago Closed 6 years ago

downloadapplied races window.close()

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

defect
Not set
normal

Tracking

(b2g18+)

RESOLVED WONTFIX
Tracking Status
b2g18 + ---

People

(Reporter: myk, Unassigned)

Details

If an app update is downloaded while the app is in the foreground and then applied when the app calls window.close() to quit itself, the downloadapplied event is dispatched before the app is unloaded, such that the app receives that event if it is listening for it (and can momentarily react to it before it gets unloaded).

This seems like a minor issue, but it is nevertheless a race condition that shouldn't occur, as the app should be unloaded before its update is applied.

Over in bug 834074, @julienw notes: "We're listening for the "appwillclose" event, maybe another event (I believe we have "appclose" too) may be more suited but this is another bug anyway."
(In reply to Julien Wajsberg [:julienw] from comment #12 bug 834074)
> We're listening for the "appwillclose" event, maybe another event (I believe
> we have "appclose" too) may be more suited but this is another bug anyway.

Didn't found another event but the kill method on the window manager does take a callback, so looks like an easy fix :)
Seems like "appclose" was existing at one point (cf [1]) but using the callback seems better :)

[1] https://github.com/mozilla-b2g/gaia/issues/832
tracking-b2g18: --- → ?
Blocks: b2g-apps-v1-next
No longer blocks: b2g-app-updates
No longer blocks: b2g-apps-v1-next
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.