Closed Bug 790815 Opened 12 years ago Closed 12 years ago

appStatus is not properly set for packaged apps

Categories

(Core Graveyard :: DOM: Apps, defect)

defect
Not set
normal

Tracking

(blocking-basecamp:+)

RESOLVED FIXED
mozilla18
blocking-basecamp +

People

(Reporter: dchanm+bugzilla, Unassigned)

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

Attached patch add appStatus to app object (obsolete) — Splinter Review
packages apps will always be assigned a status of Ci.nsIPrincipal.APP_STATUS_INSTALLED;

This is due to appStatus being added to the wrong object

From installPackage in Webapps.jsm [1]

615           if (!checkAppStatus(msg.app.manifest)) {
616             throw "INVALID_SECURITY_LEVEL";
617           }
618 
619           msg.appStatus = getAppStatus(msg.app.manifest);
620           Services.obs.notifyObservers(this, "webapps-ask-install",
621                                              JSON.stringify(msg));

L619 adds appStatus to the msg object.
This is passed to doInstall in webappsUI.jsm [2]
which returns to confirmInstall in webapps.jsm


337     let app = aData.app;
...
358 
359     let appObject = AppsUtils.cloneAppObject(app);
360     appObject.appStatus = app.appStatus || Ci.nsIPrincipal.APP_STATUS_INSTALLED;
361     appObject.installTime = app.installTime = Date.now();

confirmInstall retrieves app from "msg"
then accesses app.appStatus which is undefined L360
appStatus is defined at aData.appStatus

patch attached changes L619 to assign to msg.app.appStatus. Alternative is to pull the status from aData.appStatus


[1] - http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#619
[2] - http://mxr.mozilla.org/mozilla-central/source/browser/modules/webappsUI.jsm#106
Attachment #660623 - Flags: review?(fabrice)
Blocks: 786850
Attachment #660623 - Flags: review?(fabrice) → review+
Comment on attachment 660623 [details] [diff] [review]
add appStatus to app object

David, can you set the Author field and commit message on your patch?
No longer blocks: 786850
Moving over review from previous patch.

Fabrice: I'm assuming this is the output you want?
Attachment #660623 - Attachment is obsolete: true
Attachment #660632 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/462d7c9e496b
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Definitely a requirement.
blocking-basecamp: ? → +
Whiteboard: [qa-]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: