News for hackers. Stuff that matters.
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by CodeWriter23 on Wednesday March 22, 2017 @12:51PM (#13932528)
Obviously it works on Linux; the slow down is the direct result of OneDrive's User-Agent based code paths.
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by popey456963 on Wednesday March 22, 2017 @12:59PM (#13932619)
This.

People forget that they're _actively_ appearing to break it by using this UA detection. No company should _ever_ use user-agents for feature detection, because user agents themselves are screwy in so many ways [0]. Honestly, I feel like this was someone actively deciding to break the system on Linux (or any unrecognised UA). Wouldn't any reasonable developer just send back a fully-featured page if they couldn't understand a UA?

[0] http://webaim.org/blog/user-agent-string-history/

Re:Onedrive is slow on Linux but fast with a “Windows” user-... by derefr on Wednesday March 22, 2017 @01:20PM (#13932821)
UA "detection" is an unworkable mess (i.e. a bad idea) when it's trying to differentiate between different consumer web browsers. But UA detection works just fine when it's only trying to differentiate between browsers as a whole, and things that are not browsers—like web spiders, or curl(1), or your native client app.

I have a feeling that this is the latter case. The detection code was likely written to give a higher QOS priority to direct browser access, and a lower QOS priority to the native OneDrive sync service built into Windows (because it happens in the background.) But in doing so, they probably made the check ask the wrong question—"is this a browser" instead of "is this our client"—and thus wrote the check with a browser whitelist pattern (that was never tested outside of UA strings from browsers on Windows), rather than a blacklist pattern (their one sync-service UA.)

Re:Onedrive is slow on Linux but fast with a “Windows” user-... by sqeaky on Wednesday March 22, 2017 @02:14PM (#13933297)
Doesn't giving web crawlers different pages than the user facing UI get you kicked out of search engine indexes? The original ticket indicated different pages were served, not just QOS.
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by derefr on Wednesday March 22, 2017 @04:36PM (#13934654)
(I think) we're talking about pages served to logged-in users—i.e. the pages for files and folders in a given user's OneDrive account. Web crawlers wouldn't be able to reach those either way, so it (inconveniently from a fail-early perspective) wouldn't affect anything if the detection code does something stupid/crazy in the case of crawlers.
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by nathantotten on Wednesday March 22, 2017 @01:06PM (#13932688)
You don't know when this code was written or what the original purpose was. User agent detection used to be a best practice. Onedrive for business is a mountain of legacy software going from sharepoint to groove to who knows what. This bug could be buried in some library that was written 5+ years ago. Maliciously going out of your way to not support Linux sounds like a good way to have your code review rejected.
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by emn13 on Wednesday March 22, 2017 @01:25PM (#13932882)
To this day, user agent detection is the only (practical) way to avoid sending large polyfills to the 95% of clients that don't need them.
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by robocat on Wednesday March 22, 2017 @03:48PM (#13934164)
> No company should _ever_ use user-agents for feature detection

Wrong.

There are plenty of bugs that cannot be detected using feature detection, especially with events and <input> elements. Sometimes you can find a browser-agnostic workaround, but sometimes the only solution is to sniff the browser.

It is especially necessary if you need to support "obsolete" browsers that your customers still use.

It is important to really try and avoid browser sniffing when "fixing" bugs in current versions of browsers (since your "fix" is likely to break in future versions).

Note, feature detection usually implies that you are using JavaScript.

Re:Onedrive is slow on Linux but fast with a “Windows” user-... by greenhatman on Wednesday March 22, 2017 @01:09PM (#13932717)
Yea, call my cynical, but Microsoft Office is one of the few applications that doesn't have a good alternative on Linux. So this seems like a ploy to stop people from using Linux. At least the ones that would like to use Microsoft Office.
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by askmike on Wednesday March 22, 2017 @12:58PM (#13932614)
And what if some programmers are put unto fixing this, to realise the normal code path has a number of other bugs for linux? If you write web software you clearly define what you support and what you do not.

I've fallen into the "I know this browser is not supported, but everything works except for X" trap. Where you first spend a month fixing other bugs that also don't work, only to end up with a more complex QA dev process since you need to make sure all new features also work in this other browser or environment.

Re:Onedrive is slow on Linux but fast with a “Windows” user-... by dv_dt on Wednesday March 22, 2017 @01:07PM (#13932696)
It's true, but the flip side is don't offer a web based product if you can't support a wide range of web browsers on multiple OSes. This gives me flashbacks to old (hopefuly dying) "web based" enterprise apps that were browser accessible only by a one magic version of windows explorer with a giant slew of automatically downloaded browser extensions. Just produce an app if that's all that can be supported.
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by askmike on Wednesday March 22, 2017 @03:55PM (#13934234)
You are right, but I guess Microsoft is somewhat biased towards their own products (Windows in this case).
Re:Onedrive is slow on Linux but fast with a “Windows” user-... by simias on Wednesday March 22, 2017 @01:03PM (#13932657)
If said code paths work correctly on the supported operating systems and browsers why does it matter? You could say that it's a poor technical decision but that's really not up to the support to address.

I guess you could reproduce the bug on a supported OS and browser by manually changing the user agent but I doubt the support would accept that either. It would be like complaining that the site becomes unusable if you disable javascript or images, they probably only support "vanilla" browsers.