Closed Bug 832434 Opened 11 years ago Closed 6 years ago

Failed package app update displays directory listing on next run of b2g

Categories

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

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: nick, Unassigned)

Details

Attachments

(1 file)

In b2g desktop, install packaged app.  Packaged app fails to install update (INSTALL_FROM_DENIED).  Quit out of b2g desktop.  Restart.  Open package app that failed to update.  index.html is not opened, instead a directory listing of the zip is displayed.  The packaged app appears to be in a malformed state due to failed update.
That sounds bad. Can you reproduce this on device?
Also, please give STR. We can't do much without them.
1. Download Nightly Desktop b2g
   http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/

2. Download gaia, myk's branch
   git clone git://github.com/mykmelez/gaia.git -b packaged-app-stub
   git checkout packaged-app-stub
   make

3. Run b2g-bin with myk's gaia profile
   ./b2g-bin -profile ~/mozilla/myk-gaia/profile

4. Wait for notification of app update, or run Packaged App
   (second page of list of pps on homescreen) and click update.

5. Update Fails

6. Quit out of b2g-bin

7. Restart b2g-bin with myk's profile
   ./b2g-bin -profile ~/mozilla/myk-gaia/profile

8. Open Packaged App

9. index.html is not displayed.  Instead, a listing of files in the zip is shown.
The stub app is not packaged correctly:
- there should not be a "launch_path" property in the update.webapp manifest
- we don't install preloaded packaged apps in eng or desktop builds. You have to test that on device with a VARIANT=user build (install your own gaia with "PRODUCTION=1 make production" in gaia)
(In reply to Fabrice Desré [:fabrice] from comment #5)
> The stub app is not packaged correctly:
> - there should not be a "launch_path" property in the update.webapp manifest

If we remove it, then the bug happens the first time the app is run, even before the update fails, because webapp-manifests.js doesn't copy a preloaded packaged app's manifest.webapp file into the profile, only its update.webapp file (and application.zip package) <https://github.com/mozilla-b2g/gaia/blob/4973f952862d1ec6a18ce430201160dcb7a84d93/build/webapp-manifests.js#L112>; and Webapps.jsm treats update.webapp as the app's manifest if its manifest.webapp is missing <http://hg.mozilla.org/mozilla-central/file/fdc7bbbc2eea/dom/apps/src/Webapps.jsm#l1783>.


> - we don't install preloaded packaged apps in eng or desktop builds. You
> have to test that on device with a VARIANT=user build (install your own gaia
> with "PRODUCTION=1 make production" in gaia)

Maybe we're talking about different things, but Gaia's build scripts very much *do* install my test preloaded packaged app stub (located in the external-apps/{1a48a62b-89dc-b843-83de-a0388c559cd2}/ subdirectory of my Gaia fork <https://github.com/mykmelez/gaia/tree/packaged-app-stub/external-apps/%7B1a48a62b-89dc-b843-83de-a0388c559cd2%7D>) into a profile that I create with "make [profile]".

And that app is then present when I run B2G Desktop with that profile.  If it wasn't, Nick and I would never have been able to get to step 4 of the Steps to Reproduce in comment 3.
Myk, the mechanism to preload packaged apps is only designed to work properly on device, with VARIANT=user builds. Any other configuration is grey zone.
(In reply to Fabrice Desré [:fabrice] from comment #7)
> Myk, the mechanism to preload packaged apps is only designed to work
> properly on device, with VARIANT=user builds. Any other configuration is
> grey zone.

Understood.  I know B2G Desktop is not supported.  And we'll want to test this on a device to confirm it.  But at first glance the problem doesn't seem likely to be desktop-specific, so I wouldn't dismiss it just because we haven't tested on device yet.

Nevertheless, it's also an edge case, since normally updates will apply successfully (even though they're failing in our test case).  So I wouldn't worry about it too much.
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.

Attachment

General

Created:
Updated:
Size: