On 15/12/2016 17:20, Ben Kelly wrote:
On Thu, Dec 15, 2016 at 12:06 PM, Boris Zbarsky <bzbar...@mit.edu> wrote:

On 12/15/16 11:23 AM, Ben Kelly wrote:

if (navigator.connect.downlinkMax > 100) {
  // perform low-priority background downloads
}


Why is the downlinkMax the right thing to be checking here, though? Again,
outside of the "cellphone on a cell network" case, the last-hop bandwidth
tells you pretty much nothing because it's incredibly unlikely that the
last hop is the bottleneck.


Its more information than nothing.

But if it is seriously inaccurate or misleading information (e.g. it suggests a fast connection, when the "fast" last-hop is just my laptop being tethered to a cellphone that has a slow, expensive connection), then it may be worse than nothing.

 And saying its a limit on the maximum
is accurate.  And its a value that can become more accurate over time with
better OS and network integration.

Not necessarily, if it is explicitly spec'd to refer to the speed of the last hop. ("The spec is pretty clearly written to specify maximum possible downlink given the first hop interface.")

Code using the API gets that for free
without changing anything.  If it special cases on "cellular" or "wifi",
then it has to update its list if a new networking type is introduced in
the future.

If better network integration means that in future, we can reliably report the overall bandwidth of the connection to a given server (for example), or the cost per byte transferred (perhaps more interesting, in many cases), that would presumably be exposed via a new API, not by redefining what this API does. But that means code doesn't "get that for free", it will need to be updated.


I agree that for the "cellphone on a cell network" case the last-hop
bandwidth can be useful.


Bluetooth networking is also a thing.

I think being able to distinguish this stuff provides some value even if
its not perfect for all cases.  And I don't see how it causes any harm.

It causes harm if it (mis)leads a site/web-app into doing things -- such as large downloads over a metered connection, because the last hop happens to look fast -- that are not appropriate for the true nature of the user's connection.

Arguably, it might be better to not expose such potentially misleading information at all; then such a site or app would not be tempted to rely on it, and would have to find an alternative approach (perhaps simply asking the user "do you want to download X megabytes of stuff?").

JK

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to