Install packaged app ignores provided zip, and zips all other files instead

RESOLVED INVALID

Status

()

Firefox
Developer Tools: WebIDE
RESOLVED INVALID
2 years ago
7 months ago

People

(Reporter: birtles, Unassigned)

Tracking

Trunk
x86_64
Windows 10
Points:
---

Firefox Tracking Flags

(firefox45 affected)

Details

Attachments

(1 attachment)

8.99 KB, application/octet-stream
Details
(Reporter)

Description

2 years ago
Created attachment 8687772 [details]
Test add-on

STR (On Windows):
1. Download the attached add-on and extract it.
2. Run 'npm install' from the extracted add-on folder
   (This will create a node_modules folder and download gulp to it)
3. Open WebIDE
4. Connect a device
5. Choose Open Packaged App...
6. Choose the add-on folder
7. Press "Play" to install the app on the device

Expected results:
The add-on is installed successfully.

Actual results:
Operation fails with the following log:

"Operation failed: installing and running app: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFile.isHidden]"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 32"  data: no]" webide.js:354:5
UI.reportError() webide.js:354
UI.busyUntil/<() webide.js:335
Handler.prototype.process() Promise-backend.js:937
this.PromiseWalker.walkerLoop() Promise-backend.js:813
(Async: Promise) this.PromiseWalker.scheduleWalkerLoop() Promise-backend.js:744
this.PromiseWalker.schedulePromise() Promise-backend.js:776
this.PromiseWalker.completePromise() Promise-backend.js:711
TaskImpl_handleException() Task.jsm:448
TaskImpl_run() Task.jsm:326
Handler.prototype.process() Promise-backend.js:937
this.PromiseWalker.walkerLoop() Promise-backend.js:813
(Async: Promise) this.PromiseWalker.scheduleWalkerLoop() Promise-backend.js:744
this.PromiseWalker.schedulePromise() Promise-backend.js:776
Promise.prototype.then() Promise-backend.js:451
AppActorFront.prototype._install() app-actor-front.js:793
AppActorFront.prototype.installPackaged() app-actor-front.js:758
exports.AppManager.installAndRunProject/<() app-manager.js:655
TaskImpl_run() Task.jsm:314
Handler.prototype.process() Promise-backend.js:934
this.PromiseWalker.walkerLoop() Promise-backend.js:813
(Async: Promise) this.PromiseWalker.scheduleWalkerLoop() Promise-backend.js:744
this.PromiseWalker.schedulePromise() Promise-backend.js:776
this.PromiseWalker.completePromise() Promise-backend.js:711
onSuccess() osfile_native.jsm:63

Exception { message: "Component returned failure code: 0x…", result: 2152857618, name: "NS_ERROR_FILE_NOT_FOUND", filename: "resource://gre/modules/commonjs/too…", lineNumber: 32, columnNumber: 0, inner: null, data: null, stack: "addDirToZip@resource://gre/modules/…", location: XPCWrappedNative_NoHelper } webide.js:337:11
UI.busyUntil/<() webide.js:337
Handler.prototype.process() Promise-backend.js:937
this.PromiseWalker.walkerLoop() Promise-backend.js:813
(Async: Promise) this.PromiseWalker.scheduleWalkerLoop() Promise-backend.js:744
this.PromiseWalker.schedulePromise() Promise-backend.js:776
this.PromiseWalker.completePromise() Promise-backend.js:711
TaskImpl_handleException() Task.jsm:448
TaskImpl_run() Task.jsm:326
Handler.prototype.process() Promise-backend.js:937
this.PromiseWalker.walkerLoop() Promise-backend.js:813
(Async: Promise) this.PromiseWalker.scheduleWalkerLoop() Promise-backend.js:744
this.PromiseWalker.schedulePromise() Promise-backend.js:776
Promise.prototype.then() Promise-backend.js:451
AppActorFront.prototype._install() app-actor-front.js:793
AppActorFront.prototype.installPackaged() app-actor-front.js:758
exports.AppManager.installAndRunProject/<() app-manager.js:655
TaskImpl_run() Task.jsm:314
Handler.prototype.process() Promise-backend.js:934
this.PromiseWalker.walkerLoop() Promise-backend.js:813
(Async: Promise) this.PromiseWalker.scheduleWalkerLoop() Promise-backend.js:744
this.PromiseWalker.schedulePromise() Promise-backend.js:776
this.PromiseWalker.completePromise() Promise-backend.js:711
onSuccess() osfile_native.jsm:63

A promise chain failed to handle a rejection. Did you forget to '.catch', or did you forget to 'return'?
See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise

Date: Mon Nov 16 2015 13:44:07 GMT+0900
Full Message: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFile.isHidden]
Full Stack: JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 32
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: addDirToZip :: line 43
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: zipDirectory :: line 72
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: installPackaged :: line 237
JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/apps/app-actor-front.js :: AppActorFront.prototype.installPackaged/request :: line 751
JS frame :: resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js :: Handler.prototype.process :: line 934
JS frame :: resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js :: this.PromiseWalker.walkerLoop :: line 813


It appears that we are grabbing all the contents in the folder and making up a zip of it. That means going through node_modules which, apart from being wasteful of device storage and download time, means we can often hit a limit in Windows file path lengths.

Also, I think this behavior is quite surprising. The docs[1] suggest it is the zip file that is transferred, not the whole contents of the directory.

If you delete the node_modules directory, the package installs but it doesn't run (as confirmed by checking the console) since the javascript file is *only* inside the package.zip, not also available unzipped in the folder. In fact, it seems the zip specified in package_path in update.webapp is not used at all.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Add-ons/Developing_Firefox_OS_add-ons
Apps are being removed with B2G cleanup.
Status: NEW → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.