Closed
Bug 983880
Opened 11 years ago
Closed 9 years ago
[tracking] Use feature-detection API
Categories
(Marketplace Graveyard :: General, defect, P3)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: clouserw, Unassigned)
References
()
Details
(Keywords: productwanted, Whiteboard: [dependency: WebAPI][marketplace-transition])
The feature detection API is going to be privileged for now which means we'll need to request the permission in the marketplace we ship with 1.3. We should do this as soon as we can since their code is freezing.
We can do this before bug 983502 closes if we know what the permission is called and if requesting a non-existent permission is simply ignored by the client.
Requesting 1.3T? because the Marketplace is a packaged app and needs to ship with this on the phone if we're going to support low memory app filtering.
Note that only the pages in the app-package itself will have access to the API. So we'll also need to change the code in the app package so that it forwards the needed information to whatever pages want it. Obviously up to you how you do that forwarding. I.e. if you use parent.postMessage to ask for the information, or if you make the package app send the information as part of the URL when opening the marketplace.
Comment 2•11 years ago
|
||
(In reply to Wil Clouser [:clouserw] from comment #0)
> The feature detection API is going to be privileged for now which means
> we'll need to request the permission in the marketplace we ship with 1.3.
> We should do this as soon as we can since their code is freezing.
>
> We can do this before bug 983502 closes if we know what the permission is
> called and if requesting a non-existent permission is simply ignored by the
> client.
>
Non-existing permissions will print a warning in logcat but it should still work.
blocking-b2g: 1.3T? → 1.3T+
Reporter | ||
Comment 3•11 years ago
|
||
Thanks. Ehsan (or anyone) - if you know what the permission will be called, let us know.
See comment 3
Flags: needinfo?(ehsan)
Comment 5•11 years ago
|
||
(In reply to Wil Clouser [:clouserw] from comment #3)
> Thanks. Ehsan (or anyone) - if you know what the permission will be called,
> let us know.
See https://wiki.mozilla.org/WebAPI/Navigator.hasFeature#Supported_feature_names please.
Flags: needinfo?(ehsan)
The question is what the *permission* will be called. I.e. what do you put in the manifest in order to get to use this API?
Flags: needinfo?(ehsan)
Comment 7•11 years ago
|
||
I vote for "feature-detection"
Comment 8•11 years ago
|
||
Please re-triage. Explain why this has to block 1.3T. Could we solve this with a unique UA string? (thats common for devices anyway). Every 1.3T devices will have the same UA and the same hardware config.
blocking-b2g: 1.3T+ → 1.3T?
Comment 9•11 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #6)
> The question is what the *permission* will be called. I.e. what do you put
> in the manifest in order to get to use this API?
Ah, sorry, I also vote for "feature-detection" as I suggested in bug 983502 comment 2.
Flags: needinfo?(ehsan)
Andreas: I'd prefer to add the feature detection API discussed here. Using the UA-string is a more fragile workaround which we really should only use short-term. The feature detection API should be very simple and low-risk so I'd rather go that route.
But I agree that if we have any trouble getting the feature detection API in in time we should just adjust the UA-string.
Comment 11•11 years ago
|
||
Risk for 1.3 and 1.3T is really high at this point. Can we do the brittle UA route for 1.3T and add this to 1.5? (the next update will be 1.3T -> 1.5).
Reporter | ||
Comment 12•11 years ago
|
||
The Marketplace code flow isn't set up to look at UA at all (we send back feature flags, not UA flags) so we'd have to write that detection and conversion (UA X = these feature flags) and then maintain it going into the future. It's error prone and doesn't scale.
In addition, this is a problem outside of Tarako as well because the methods we use for detection are being fixed and our ability to detect what devices can use is getting worse with every release. This is why the LINE app "disappeared" from the Marketplace a couple weeks ago.
Comment 13•11 years ago
|
||
We have about 8 months to fix the marketplace. We have about 2 weeks to fix 1.3T. I am not claiming that this will scale. I am claiming that it will scale to 1 use case for 1 device type so we don't have to blow our 1.3T risk budget and timeline.
Comment 14•11 years ago
|
||
(In reply to Wil Clouser [:clouserw] from comment #12)
> The Marketplace code flow isn't set up to look at UA at all (we send back
> feature flags, not UA flags) so we'd have to write that detection and
> conversion (UA X = these feature flags) and then maintain it going into the
> future. It's error prone and doesn't scale.
But you had to do that to distinguish 1.1 (gecko 18.1) from 1.0 (gecko 18.0) right? How would this situation be different?
> In addition, this is a problem outside of Tarako as well because the methods
> we use for detection are being fixed and our ability to detect what devices
> can use is getting worse with every release. This is why the LINE app
> "disappeared" from the Marketplace a couple weeks ago.
Sure, but that API will not be backported to anything but 1.3T (it will not be on 1.3 and 1.4) from 1.5.
So I would also like to not block, and would consider an uplift it that happens to be ready.
blocking-b2g: 1.3T? → 1.3?
Comment 15•11 years ago
|
||
Based on the discussion here this should go into 1.5. Once ready we can consider an uplift, but that seems unlikely.
blocking-b2g: 1.3? → 1.5?
Comment 16•11 years ago
|
||
Andreas -
Who should we be working with re: timelines? (program and / or product manager)
We've been hearing dates as early as June.
Who is my counterpart to coordinate the teams?
Flags: needinfo?(gal)
Reporter | ||
Comment 17•11 years ago
|
||
> We have about 8 months to fix the marketplace. We have about 2 weeks to fix
> 1.3T. I am not claiming that this will scale. I am claiming that it will
> scale to 1 use case for 1 device type so we don't have to blow our 1.3T risk
> budget and timeline.
This may be a misunderstanding from me - the Marketplace is targeting June for having consumers using the Marketplace. Is the phone going to market in November? Link where I can see the timeline?
> > The Marketplace code flow isn't set up to look at UA at all (we send back
> > feature flags, not UA flags) so we'd have to write that detection and
> > conversion (UA X = these feature flags) and then maintain it going into the
> > future. It's error prone and doesn't scale.
>
> But you had to do that to distinguish 1.1 (gecko 18.1) from 1.0 (gecko 18.0)
> right? How would this situation be different?
I don't think we do because 1.0 never had enough usage to justify it. I'll look into it though.
> > In addition, this is a problem outside of Tarako as well because the methods
> > we use for detection are being fixed and our ability to detect what devices
> > can use is getting worse with every release. This is why the LINE app
> > "disappeared" from the Marketplace a couple weeks ago.
>
> Sure, but that API will not be backported to anything but 1.3T (it will not
> be on 1.3 and 1.4) from 1.5.
Ah, that's a shame. I'll drop that from here then as it doesn't seem relevant.
> Based on the discussion here this should go into 1.5. Once ready we can
> consider an uplift, but that seems unlikely.
I'm concerned that we made an announcement 3 weeks ago that we're focused on code quality but now that we're bumping up against a deadline we're not giving that affordance to the Marketplace team by having them maintain this admittedly brittle detection. Temporary things at Mozilla easily become permanent things. We've been talking about this for a year (bug 900241 & friends) and now you're bumping this to 1.5 - this was promised in (I think?) 1.2, and then 1.3, and now 1.5, and something else is going to be important when we're working on 1.5 and what's going to keep this from getting bumped again?
Reporter | ||
Comment 18•11 years ago
|
||
Oh, meant to ask above: what is the UA that Tarako is shipping with?
Reporter | ||
Comment 20•11 years ago
|
||
You mean match /Gecko 28\.1/ ? I think that would work but I'm not super familiar with where we use our UAs so I can't say whether that would be used elsewhere.
Reporter | ||
Comment 21•11 years ago
|
||
needinfo for comment 20. I'm not sure if we're confirmed on that string yet or not.
Flags: needinfo?(gal)
Comment 22•11 years ago
|
||
(In reply to Wil Clouser [:clouserw] from comment #21)
> needinfo for comment 20. I'm not sure if we're confirmed on that string yet
> or not.
Yeah, the patch is ready in my queue.
Comment 24•11 years ago
|
||
The UA change patch is in bug 987450
Updated•11 years ago
|
Whiteboard: [marketplace]
Comment 25•11 years ago
|
||
Let's use the dependency here to track the blocking-b2g need here.
blocking-b2g: 2.0? → ---
Updated•11 years ago
|
Summary: Request feature-detection API → Use feature-detection API
Comment 26•11 years ago
|
||
Added spreadsheet for testing based on https://github.com/mozilla/fireplace/blob/95843c8/hearth/media/js/buckets.js#L52
Whiteboard: [marketplace] → [dependency: WebAPI]
Comment 27•11 years ago
|
||
(In reply to David Bialer [:dbialer] from comment #26)
> Added spreadsheet for testing based on
> https://github.com/mozilla/fireplace/blob/95843c8/hearth/media/js/buckets.
> js#L52
do we want the manifest fields on the list too (bug 900241), even though they aren't currently detected?
Comment 28•11 years ago
|
||
(In reply to Andrew Williamson [:eviljeff] from comment #27)
> (In reply to David Bialer [:dbialer] from comment #26)
> > Added spreadsheet for testing based on
> > https://github.com/mozilla/fireplace/blob/95843c8/hearth/media/js/buckets.
> > js#L52
>
> do we want the manifest fields on the list too (bug 900241), even though
> they aren't currently detected?
Yes we do, but I am struggling on this. If manifest fields are only detectable from 2.0 forward, the existing ones new fields would always be supported. what we really want to do is test for any manifest field/value pairs - correct?
Comment 29•11 years ago
|
||
(In reply to David Bialer [:dbialer] from comment #28)
> (In reply to Andrew Williamson [:eviljeff] from comment #27)
> > (In reply to David Bialer [:dbialer] from comment #26)
> > > Added spreadsheet for testing based on
> > > https://github.com/mozilla/fireplace/blob/95843c8/hearth/media/js/buckets.
> > > js#L52
> >
> > do we want the manifest fields on the list too (bug 900241), even though
> > they aren't currently detected?
>
> Yes we do, but I am struggling on this. If manifest fields are only
> detectable from 2.0 forward, the existing ones new fields would always be
> supported.
For the most part, yes (role would vary by platform). Though as the feature-detection API will only be in 2.0 also, a lot of the features on the list will always be true too.
> what we really want to do is test for any manifest field/value pairs - correct?
yes (afaik)
Updated•11 years ago
|
No longer blocks: tarako-marketplace
Reporter | ||
Comment 30•11 years ago
|
||
The blockers for this bug are closed and we can get moving on this! Hooray, thanks for the help from everyone pushing on this.
Documentation for hasFeature/getFeature is at https://wiki.mozilla.org/WebAPI/Navigator.hasFeature
Due to the nature of this API and the desire that APIs become less privileged over time, items in this API may disappear and become accessible through regular methods instead of this API. For the currently privileged APIs, it's suggested we use the API as follows:
> if ("push" in navigator) {
> // navigator.push is available with the current set of permissions
> } else {
> navigator.hasFeature("api.window.Navigator.push").then(function(val) {
> if (val) {
> // navigator.push exists in a higher privilege context
> }
> });
> }
There has been a lot of discussion and moving parts around this API so if something isn't clear please come ask me for Marketplace stuff or :ehsan for API questions. Thanks!
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → mpillard
Reporter | ||
Comment 31•10 years ago
|
||
Removing priority until dbialer can sync up with people and get back to us.
Priority: P1 → --
Comment 32•10 years ago
|
||
Note that I did play with the API, even though I haven't committed anything yet. Some feedback:
- It works :)
- It's for privileged apps only, it needs a permission. Which means it'll never be usable in a browser (Desktop, Android, Firefox OS outside our package, etc).
- This means we can only use feature detection on Firefox OS (and only if we are inside the package). We can't use the `if ("push" in navigator)` style of checking, because everytime something is absent, we don't know if it's because a lack of permissions/privileges in Marketplace or because the feature is really not there.
- I like the fact that it's an asynchronous API, but unfortunately with the way our feature detection works right now, we have to wait for all feature detection checks to return before making the first API call that returns apps, so we don't benefit from that.
- It'd be interesting, later in the future, to get more info about the hardware. Something like hardware.bluetooth, hardware.camera, etc - right now we can use this API to know if a phone has support for the bluetooth API but we don't know if the device actually has bluetooth capabilities.
Reporter | ||
Updated•10 years ago
|
Keywords: productwanted
Comment 33•10 years ago
|
||
Another piece of feedback:
- This doesn't solve the problem of permissions change for some APIs. When an API goes from certified-apps only to privileged-apps only, we have no way to detect that. For instance, bluetooth is currently a certified API. If it were to become available to privileged apps, a developer could submit an app to Marketplace using that API, but we wouldn't be able to hide that app from devices running older versions of Firefox OS where this API is still only available for certified apps.
Updated•10 years ago
|
Blocks: Loopmov_1_1
Updated•10 years ago
|
No longer blocks: Loopmov_1_1
Updated•10 years ago
|
Summary: Use feature-detection API → [tracking] Use feature-detection API
Updated•10 years ago
|
Assignee: mpillard → nobody
Updated•10 years ago
|
Updated•10 years ago
|
Priority: -- → P3
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Whiteboard: [dependency: WebAPI] → [dependency: WebAPI][marketplace-transition]
You need to log in
before you can comment on or make changes to this bug.
Description
•