Closed
Bug 826935
Opened 12 years ago
Closed 12 years ago
ensure app.installState is defined in DOMApplicationRegistry.loadCurrentRegistry()
Categories
(Core Graveyard :: DOM: Apps, defect)
Core Graveyard
DOM: Apps
Tracking
(blocking-basecamp:+, firefox19 wontfix, firefox20 fixed, b2g18 fixed)
People
(Reporter: myk, Assigned: myk)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file)
934 bytes,
patch
|
fabrice
:
review+
myk
:
checkin+
|
Details | Diff | Splinter Review |
If an app record in webapps.json has no installState property, then DOMApplicationRegistry.loadCurrentRegistry() doesn't define it when reading webapps.json into its DOMApplicationRegistry.webapps object (unlike WebappsApplication.init(), which sets it to "installed").
That causes problems when DOMApplicationRegistry.startDownload() is called to update an installed app with no installState, because the isUpdate local variable will be set to false instead of true, and the installState will eventually wind up being "pending" instead of "updating" when this code is evaluated near the end of the function:
if (app.installState == "pending") {
// We restarted a failed download, apply it automatically.
DOMApplicationRegistry.applyDownload(aManifestURL);
}
But the download isn't failed; and it shouldn't be applied automatically.
The Gaia build scripts don't set installState, so you'll run into this problem if you start B2G for the first time with a new Gaia profile, check for a packaged app update, and find one; which is exactly what we hope will happen to users who get devices with preloaded packaged app stubs that trigger update checks.
Perhaps the build scripts should set this property. But DOMApplicationRegistry shouldn't depend on it being set, just as WebappsApplication doesn't. Ideally, we also wouldn't have two different types of app object with completely different initialization routines, but fixing that is risky. The minimal fix here is for DOMApplicationRegistry to set installState to "installed" if it's undefined.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #698188 -
Flags: review?(fabrice)
Comment 2•12 years ago
|
||
Comment on attachment 698188 [details] [diff] [review]
patch v1: ensures app.installState is defined
I think Fabrice is out. And backup reviewer #2 ferjm is out too. So backup reviewer #3 is Jonas.
Attachment #698188 -
Flags: review?(fabrice) → review?(jonas)
Updated•12 years ago
|
Attachment #698188 -
Flags: review?(jonas) → review+
Updated•12 years ago
|
blocking-basecamp: ? → +
Comment 3•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Whiteboard: [qa-]
Assignee | ||
Comment 4•12 years ago
|
||
Comment on attachment 698188 [details] [diff] [review]
patch v1: ensures app.installState is defined
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=3e5ec076ceb2
Attachment #698188 -
Flags: checkin+
Comment 5•12 years ago
|
||
Updated•12 years ago
|
Updated•7 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•