Bug 893848 - Manifest properties aren't updated when installing apps multiple times. r=fabrice

This commit is contained in:
Alexandre Poirot 2013-09-10 12:52:56 -04:00
parent ce5974e3b3
commit 7ce4dbf948

View File

@ -149,6 +149,11 @@ WebappsActor.prototype = {
let reg = DOMApplicationRegistry;
let self = this;
// Clean up the deprecated manifest cache if needed.
if (aId in reg._manifestCache) {
delete reg._manifestCache[aId];
}
aApp.installTime = Date.now();
aApp.installState = "installed";
aApp.removable = true;
@ -167,12 +172,24 @@ WebappsActor.prototype = {
reg._saveApps(function() {
aApp.manifest = manifest;
// Needed to evict manifest cache on content side
// (has to be dispatched first, otherwise other messages like
// Install:Return:OK are going to use old manifest version)
reg.broadcastMessage("Webapps:PackageEvent",
{ type: "installed",
manifestURL: aApp.manifestURL,
app: aApp,
manifest: manifest
});
reg.broadcastMessage("Webapps:AddApp", { id: aId, app: aApp });
reg.broadcastMessage("Webapps:Install:Return:OK",
{ app: aApp,
oid: "foo",
requestID: "bar"
});
delete aApp.manifest;
self.conn.send({ from: self.actorID,
type: "webappsEvent",