Closed Bug 859688 Opened 11 years ago Closed 11 years ago

[Tef][Market] In Marketplace the user is offered to install a preinstalled app whereas he should be offered to launch it instead

Categories

(Firefox OS Graveyard :: Gaia, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g18+)

RESOLVED FIXED
Tracking Status
b2g18 + ---

People

(Reporter: sync-1, Assigned: yurenju)

References

Details

(Whiteboard: [apps watch list][customization][TD-44095][3rd Party])

Attachments

(2 files, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #434394 +++
 
 SW115
 AU_LINUX_GECKO_ICS_STRAWBERRY_V1.01.00.01.19.044
 Firefox os  v1.0.1
 Mozilla build ID: 20130319070203
 
 DEFECT DESCRIPTION:
  Marketplace can still see the same pre-installed app and can be installed. 
 
  REPRODUCING PROCEDURES:
  Enter to market,Marketplace can still see the same pre-installed app and can   be installed. --->KO
 
  EXPECTED BEHAVIOUR:
  Marketplace should not see the same pre-installed app.
 
  ASSOCIATE SPECIFICATION:
 
  TEST PLAN REFERENCE:
 
  TOOLS AND PLATFORMS USED:
 SW115
  USER IMPACT:
 
  REPRODUCING RATE:
 5/5
  For FT PR, Please list reference mobile's behavior:
 
 ++++++++++ end of initial bug #434394 description ++++++++++
 
 
 
 CONTACT INFO (Name,Phone number):
 
  DEFECT DESCRIPTION:
 
  REPRODUCING PROCEDURES:
 
  EXPECTED BEHAVIOUR:
 
  ASSOCIATE SPECIFICATION:
 
  TEST PLAN REFERENCE:
 
  TOOLS AND PLATFORMS USED:
 
  USER IMPACT:
 
  REPRODUCING RATE:
 
  For FT PR, Please list reference mobile's behavior:
Whiteboard: [apps watch list1]
Component: Gaia → Consumer Pages
Product: Boot2Gecko → Marketplace
Version: unspecified → 1.0
Which app are you referring to as "the same pre-installed app"?
Flags: needinfo?(sync-1)
Whiteboard: [apps watch list1] → [apps watch list]
caculator, twitter, facebook, youtube, wikipedia,which are already pre-install,
but when open marketplace, we can still search above apps and install them again.

Currently,marketplace seems not goes well, so i can't reproduce the bug.
Flags: needinfo?(sync-1)
Are these apps installed from a different origin?

We're using navigator.mozApps.getInstalled() to get a list of the installed apps. And if the app is installed, we instead show the "Launch" button.


If they were installed from somewhere other than marketplace.firefox.com, then we won't be able to determine that the app is already installed.
Flags: needinfo?(ying.tan)
Jason - is this a problem with the build process do you think?
Flags: needinfo?(jsmith)
(In reply to Andrew Williamson [:eviljeff] from comment #4)
> Jason - is this a problem with the build process do you think?

Potentially if it's a hosted app. I don't think there's anything we can do here if it's a packaged app, given that the origin is right now app://{UUID} on install vs. what's called out in the external apps.

So we could fix this client-side for hosted apps, but I don't think it's possible to fix for packaged apps until they have a defined origin.
Flags: needinfo?(jsmith)
Component: Consumer Pages → Gaia
Priority: P1 → --
Product: Marketplace → Boot2Gecko
Version: 1.0 → unspecified
(In reply to Jason Smith [:jsmith] from comment #5)
> (In reply to Andrew Williamson [:eviljeff] from comment #4)
> > Jason - is this a problem with the build process do you think?
> 
> Potentially if it's a hosted app. I don't think there's anything we can do
> here if it's a packaged app, given that the origin is right now app://{UUID}
> on install vs. what's called out in the external apps.
> 
> So we could fix this client-side for hosted apps, but I don't think it's
> possible to fix for packaged apps until they have a defined origin.

The apps called out in Comment 2 are a combination of hosted and packaged apps (calculator and YouTube are packaged, FB, Twitter, Wikipedia are hosted).
I guess navigator.mozApps.getInstalled() returns apps that have a matching installOrigin[1] in their App object.  So it sounds like the fix is to have the build process set installOrigin to marketplace in the local DB (or however its implemented in Gaia).  

https://developer.mozilla.org/en-US/docs/DOM/App#Properties
Attached file incoming call when playing poppit (obsolete) —
Flags: needinfo?(ying.tan)
(In reply to Chris Van Wiemeersch [:cvan] from comment #3)
> Are these apps installed from a different origin?
> 
> We're using navigator.mozApps.getInstalled() to get a list of the installed
> apps. And if the app is installed, we instead show the "Launch" button.
> 
> 
> If they were installed from somewhere other than marketplace.firefox.com,
> then we won't be able to determine that the app is already installed.

recently,marketplace display abnormal, so i havn't reproduce the bug.
above attachment is an Error uploading.
(In reply to zhiming.tang from comment #8)
> Created attachment 744501 [details]
> incoming call when playing poppit

Is this attachment meant for this bug?  It doesn't seem related.
yes,have no related,i upload it by mistake,and don't know how to delete the attachment.
Attachment #744501 - Attachment is obsolete: true
Test on 
AU_LINUX_GECKO_ICS_STRAWBERRY_V1.01.00.01.019.107
Firefox os  v1.0.1
Mozilla build ID:20130514070202

Packaged apps are ok, If an app is pre-installed, when I find it in marketplace,
the button is "Launch".

Hosted apps are still not ok.
mark tef? because this becomes a blocker for us
blocking-b2g: --- → tef?
(In reply to buri.blff from comment #13)
> mark tef? because this becomes a blocker for us

When Tony & I talked about this, we thought this was awkward behavior, but not a blocker. There isn't any data loss caused by this. No real user impact either. All that happens here is the fact that the user will get two of the same app installed - one installed from marketplace and one preinstalled.

Keep in mind we are extremely low on time right now. We should only be arguing for blockers if they are absolutely critical. I don't think this bug fits that criteria.
Caitlin - Can we get a timeline for fix?
Flags: needinfo?(cgalimidi)
(In reply to kward@mozilla.com from comment #15)
> Caitlin - Can we get a timeline for fix?

This isn't a marketplace bug - it's a client side bug. Likely due to how to how we're preinstalling apps when setting the origins on preinstall. This is a wont fix no matter what anyways for 1.01, because we don't support origins in packaged apps. That's being worked on for 1.01. Don't know why this is happening with hosted apps, however.
Flags: needinfo?(cgalimidi)
(In reply to Jason Smith [:jsmith] from comment #16)
> (In reply to kward@mozilla.com from comment #15)
> > Caitlin - Can we get a timeline for fix?
> 
> This isn't a marketplace bug - it's a client side bug. Likely due to how to
> how we're preinstalling apps when setting the origins on preinstall. This is
> a wont fix no matter what anyways for 1.01, because we don't support origins
> in packaged apps. That's being worked on for 1.01. Don't know why this is
> happening with hosted apps, however.

Ack. Bad wording. Let's try again.

This isn't going to be resolved with Caitlin's scope - if someone was to look into this, it would be likely Fabrice or Julien. It's a two-fold problem:

1. Packaged apps do not have origins
2. Probably some preinstalled apps bug

Both of these issues are client-side. The packaged app origin issue is being worked on 1.1. The preinstalled app general issue is likely what this bug targets.

However, I still stand by comment 14 - not a huge loss if this exists, given that the worst that happens here is a duplicated app on the device. That's certainly awkward, but not ship-stopping.
FWIW, marketplace also does have an installOrigin specified.
Julien - Any ideas on what the root cause problem here is?
Flags: needinfo?(felash)
I've juste duped Bug 873160 to this bug. However in that bug I've seen that there is some very strange behaviour on the device, probably because we use the manifest URL to find the correct app object to sent events to.

Therefore, the cure could be the same as the cause of these events: the marketplace could check the manifestURL of the apps, and not only the origin, because as you correctly said it, the origin for packaged apps changes for each install (except for preinstalled apps).

Although in [1] we are supposed to not allow reinstalling an app if we already have this manifest URL or an app with this origin I've verified that in the case of the Wikipedia app, we have the same manifest URL in the preinstalled app and in the marketplace, but I haven't checked on the device because I don't want to screw up and reset my dogfood device now.

I've also checked that for the HERE Maps app the marketplace correctly finds that it is installed... Reporter, in which app do you see this behavior ?

[1] http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#1819
Flags: needinfo?(felash)
(In reply to Julien Wajsberg [:julienw] from comment #21)
> 
> I've also checked that for the HERE Maps app the marketplace correctly finds
> that it is installed... Reporter, in which app do you see this behavior ?
> 
> [1]
> http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/Webapps.jsm#1819

comment 12 indicates later that this doesn't reproduce with packaged apps, but it reproduces with hosted apps. I think when I tested this, I was able to reproduce this with the Accuweather app.
Jason, do you know where the customization code was from ? Was it from https://github.com/telefonicaid/firefoxos-gaia-spain/tree/master/external-apps ? Or somewhere else ?
(In reply to Julien Wajsberg [:julienw] from comment #23)
> Jason, do you know where the customization code was from ? Was it from
> https://github.com/telefonicaid/firefoxos-gaia-spain/tree/master/external-
> apps ? Or somewhere else ?

https://github.com/telefonicaid/firefoxos-gaia-latam/tree/master/external-apps
The metadata seem good.

Jason, what does the preinstalled accuweather entry in webapps.json look like ?

I'll try it tomorrow if there's nothing obvious.
(In reply to Julien Wajsberg [:julienw] from comment #25)
> The metadata seem good.
> 
> Jason, what does the preinstalled accuweather entry in webapps.json look
> like ?
> 
> I'll try it tomorrow if there's nothing obvious.

https://github.com/telefonicaid/firefoxos-gaia-latam/blob/master/external-apps/accuweather/metadata.json

Looks fine to me. Nothing out of ordinary too.
I meant webapps.json on your device ;)
Agreed in drivers meeting between QA/Marketplace/RelMan not to block, not a functional issue so it's not worth the risk.
blocking-b2g: tef? → -
tracking-b2g18: --- → +
With AccuWeather, I get "REINSTALL_FORBIDDEN" now.

The marketplace still offers to install though.
Same for the Wikipedia app.

Should we redirect this bug to the marketplace, to see why they can't see the app ?
(In reply to Julien Wajsberg [:julienw] from comment #30)
> Same for the Wikipedia app.
> 
> Should we redirect this bug to the marketplace, to see why they can't see
> the app ?

Sure. Bouncing over there as such.
Component: Gaia → Consumer Pages
Product: Boot2Gecko → Marketplace
Version: unspecified → 1.0
(In reply to Jason Smith [:jsmith] from comment #31)
> (In reply to Julien Wajsberg [:julienw] from comment #30)
> > Same for the Wikipedia app.
> > 
> > Should we redirect this bug to the marketplace, to see why they can't see
> > the app ?
> 
> Sure. Bouncing over there as such.

I think that is bug 873600, we're testing a fix for that now.
See Also: → 873600
See Also: 873600
(In reply to Wil Clouser [:clouserw] from comment #34)
> (In reply to Jason Smith [:jsmith] from comment #31)
> > (In reply to Julien Wajsberg [:julienw] from comment #30)
> > > Same for the Wikipedia app.
> > > 
> > > Should we redirect this bug to the marketplace, to see why they can't see
> > > the app ?
> > 
> > Sure. Bouncing over there as such.
> 
> I think that is bug 873600, we're testing a fix for that now.

I don't think bug 873600 would fix this. This is reproducible on 1.01, which doesn't get hit by the implications surrounding bug 873600.
Summary: [Buri][Market] Marketplace can still see the same pre-installed app and can be installed. → [Buri][Market] In Marketplace the user is offered to install a preinstalled app whereas he should be offered to launch it instead
Ah, I think I know what the problem is on this bug. This works on packaged apps because the installOrigin listed for each preinstalled app is marketplace.firefox.com. For hosted apps, the installOrigin is specified as the origin of the app, so marketplace calling getInstalled will not find that app as such. So it looks like this could be fixed in the customization level.

Bouncing back to b2g --> gaia as such.
Component: Consumer Pages → Gaia
Product: Marketplace → Boot2Gecko
Version: 1.0 → unspecified
Whiteboard: [apps watch list] → [apps watch list][customization]
hi Amelie, do you know how to fix this per comment 36? thanks
Flags: needinfo?(mei.kong)
Yuren, looks like you'll need to change the customization again, by adding the marketplace as installOrigin.

I'd like to check that this effectively fixes it before, unless you can do that.

Another possibility is that the Marketplace could use mozApps.mgmt.getAll() instead of mozApps.getInstalled(). Otherwise there will always have this problem if the user installs an app from another origin, and then goes to the Marketplace. I'd be tempted to say this should be the real fix, but I don't know if the Marketplace has the necessary privileges to do that.
Flags: needinfo?(yurenju.mozilla)
(In reply to Julien Wajsberg [:julienw] from comment #39)
> Another possibility is that the Marketplace could use mozApps.mgmt.getAll()
> instead of mozApps.getInstalled(). Otherwise there will always have this
> problem if the user installs an app from another origin, and then goes to
> the Marketplace. I'd be tempted to say this should be the real fix, but I
> don't know if the Marketplace has the necessary privileges to do that.

That would require marketplace to become a certified app.

I do agree that this problem will always exist in some form so long as marketplace relies on using getInstalled to figure out when to show the install button or not.
Julien, could you give a example? like wikipedia?

we can re-generate external-apps/* again with new rule.
Flags: needinfo?(yurenju.mozilla) → needinfo?(felash)
(In reply to Yuren Ju [:yurenju] from comment #41)
> Julien, could you give a example? like wikipedia?
> 
> we can re-generate external-apps/* again with new rule.

Pretty much every hosted app in customization repositories do this. Example - Let's look at Facebook:

https://github.com/telefonicaid/firefoxos-gaia-latam/blob/master/external-apps/facebook/metadata.json

The installOrigin specified here is:

"installOrigin": "http://m.facebook.com"

In order to ensure that marketplace does not offer to install the preinstalled app again, you would change this to:

"installOrigin": "https://marketplace.firefox.com"
Flags: needinfo?(felash)
got it.
Assignee: nobody → yurenju.mozilla
(In reply to Jason Smith [:jsmith] from comment #40)

> That would require marketplace to become a certified app.
> 
> I do agree that this problem will always exist in some form so long as
> marketplace relies on using getInstalled to figure out when to show the
> install button or not.

So should we try to do this or is it a bad idea to make the marketplace a certified app ?
(In reply to Julien Wajsberg [:julienw] from comment #44)
> (In reply to Jason Smith [:jsmith] from comment #40)
> 
> > That would require marketplace to become a certified app.
> > 
> > I do agree that this problem will always exist in some form so long as
> > marketplace relies on using getInstalled to figure out when to show the
> > install button or not.
> 
> So should we try to do this or is it a bad idea to make the marketplace a
> certified app ?

I'd have to redirect that question over to Wil.
Flags: needinfo?(clouserw)
(In reply to Jason Smith [:jsmith] from comment #45)
> (In reply to Julien Wajsberg [:julienw] from comment #44)
> > (In reply to Jason Smith [:jsmith] from comment #40)
> > 
> > > That would require marketplace to become a certified app.
> > > 
> > > I do agree that this problem will always exist in some form so long as
> > > marketplace relies on using getInstalled to figure out when to show the
> > > install button or not.
> > 
> > So should we try to do this or is it a bad idea to make the marketplace a
> > certified app ?
> 
> I'd have to redirect that question over to Wil.

Being a certified app is a completely different workflow which we are not prepared for.
Flags: needinfo?(clouserw)
oki thanks, let's move forward with changing all installOrigin then.
Whiteboard: [apps watch list][customization] → [apps watch list][customization][TD-44095][3rd Party]
another way to fix it is partner provide all manifest urls from firefox marketplace if it exists on there. it will be better than always setting installOrigin to marketplace for all apps.
(In reply to Yuren Ju [:yurenju] from comment #48)
> another way to fix it is partner provide all manifest urls from firefox
> marketplace if it exists on there. it will be better than always setting
> installOrigin to marketplace for all apps.

We can't do that for hosted apps. Manifest URLs for hosted apps are at the control of the server where the hosted app is hosted - Marketplace cannot control this.
Renominating because it blocks a blocker
blocking-b2g: - → leo?
Attachment #768206 - Flags: review?(gasolin)
Attachment #768207 - Flags: review?(gasolin)
Comment on attachment 768206 [details]
Pointer to Github pull request: https://github.com/telefonicaid/firefoxos-gaia-spain/pull/35

look good to me, thanks yuren
Attachment #768206 - Flags: review?(gasolin) → review+
Comment on attachment 768207 [details]
Pointer to Github pull request: https://github.com/telefonicaid/firefoxos-gaia-latam/pull/31

look good to me, thanks yuren
Attachment #768207 - Flags: review?(gasolin) → review+
I'm going to close this bug since we track customization bugs differently based on who can fix it. In this case, this bug just fixed the TEF case. I'll file new bugs for the Leo & Buri case.
blocking-b2g: leo? → ---
Flags: needinfo?(mei.kong)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Summary: [Buri][Market] In Marketplace the user is offered to install a preinstalled app whereas he should be offered to launch it instead → [Tef][Market] In Marketplace the user is offered to install a preinstalled app whereas he should be offered to launch it instead
Filed bug 887829 for the leo case and bug 887827 for the Buri case.
blocking-b2g: --- → leo?
FYI - make sure comment 56 & comment 57 is read here. bug 887829 is covering the leo case for 1.1 and is already nomed. This bug is tracking the TEF customization modifications.
blocking-b2g: leo? → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: