Closed Bug 850173 Opened 11 years ago Closed 11 years ago

[Marketplace] Sometimes possible to install preinstall app twice

Categories

(Marketplace Graveyard :: Consumer Pages, defect, P2)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED FIXED
2013-03-21

People

(Reporter: djst, Assigned: robhudson)

References

Details

It seems the Marketplace doesn't always know which apps are already installed on the device. For example, it allowed me to install Nokia HERE Maps a second time. http://farm9.staticflickr.com/8392/8539481614_43e5cee501.jpg

This app was then broken and when launching I saw the contents of a directory. See screenshot: http://farm9.staticflickr.com/8111/8538372311_4495165b0a.jpg

Tested on Unagi running B2G 1.1.0.0-prerelease, build id 20130306070201, update channel beta.
I do confirm the fact we can allow a preinstalled marketplace app and installed from marketplace app to be duplicated. Fabrice - Any thoughts?

I didn't get the FTP directory with either app when I launched, although I've seen random instances that this has happened (I get a reproduction of this with a custom DOGFOOD and PRODUCTION build when I do a make reset-gaia with the stub). It's happened enough that makes me think we do have a bug here. I'll open a separate bug for that issue and leave this bug to be the "allows a preinstalled app and installed from marketplace app to be duplicated."
Component: General → DOM: Apps
Flags: needinfo?(fabrice)
Product: Boot2Gecko → Core
Version: unspecified → Trunk
Blocks: app-install
Maybe it's enough (for now) to set the origin for the preinstalled app ? Since we disallow 2 installs from same origin.
See Also: → 835545
(In reply to Julien Wajsberg [:julienw] from comment #2)
> Maybe it's enough (for now) to set the origin for the preinstalled app ?
> Since we disallow 2 installs from same origin.

For packaged apps we don't use the origin to prevent reinstalls since it's generated with a UUID, but we check the manifestURL. In the maps case, this fails because the marketplace has a manifest url which is :
https://marketplace.firefox.com/telefonica/app/7eccfd71-2765-458d-983f-078580b46a11/manifest.webapp
while the one specified in gaia/external-apps/m.here.com/metadata.json is :
https://marketplace.firefox.com/app/7eccfd71-2765-458d-983f-078580b46a11/manifest.webapp

Talking with cvan on irc, he agreed to remove the /telefonica/ portion of the url on the marketplace side.
Flags: needinfo?(fabrice)
Sending this over to marketplace based on comment 3.
Component: DOM: Apps → Consumer Pages
Product: Core → Marketplace
Version: Trunk → 1.0
Blocks: market-packaged-apps
No longer blocks: app-install
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
Rob, can we remove the CARRIER from the URL in the minifest?
Priority: -- → P3
(In reply to Chris Van Wiemeersch [:cvan] from comment #5)
> Rob, can we remove the CARRIER from the URL in the minifest?

Rob is ooto today, but will be back in tomorrow.  Please add a comment in the code when you do this so we don't wonder later.
(In reply to Chris Van Wiemeersch [:cvan] from comment #5)
> Rob, can we remove the CARRIER from the URL in the minifest?

I'm not sure where this extra /telefonica part of the URL is coming from? If I navigate to the app from Marketplace home page, I get to this page:
https://marketplace.firefox.com/app/here-maps-packaged/

Looking at the install button source I see the manifest points to the URL without the "/telefonica" in it, which is what we want.

We do, however, have middleware that allows any URL with "/telefonica" to be treated like a URL without it. But if I remove that I don't know what else is going to break -- that's there for a reason, right? That code is here:
https://github.com/mozilla/zamboni/blob/master/mkt/carriers/middleware.py
Ah, it looks like Marketplace itself is rooted at /telefonica in gaia, so all apps installed from Marketplace launched from gaia will have /telefonica in them. See:
https://github.com/mozilla-b2g/gaia/blob/master/external-apps/marketplace/metadata.json

I don't know the history of this carrier string in the URL. One fix would be to point the external-apps/m.here.com to the /telefonica URL so both are pointing to the same place. Or remove the carrier string from the marketplace app. I don't think the fix is on zamboni side.
Fabrice, which change do you think is prefered ?
Flags: needinfo?(fabrice)
I think the fix is to have the apps installed from the Marketplace in gaia to *not* have /telefonica/ in the URL.  It's there to differentiate the carrier marketplace, not to differentiate the apps installed from that marketplace.

I think this fix is on the marketplace side.
I also think apps manifest urls should be partner-agnostic. Let's fix the marketplace url in gaia in another bug if it needs to be changed.
Flags: needinfo?(fabrice)
Assignee: nobody → robhudson.mozbugs
Priority: P3 → P2
Target Milestone: --- → 2013-03-21
https://github.com/mozilla/zamboni/commit/29e70bf
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.