3 ms·
What kind of crap user-agent parsing library are people using that breaks from 2 to 3 digits? If that was a bug, I'd be pretty suspicious about the general sof
by ethbr0 5y ago
What kind of crap user-agent parsing library are people using that breaks from 2 to 3 digits?
If that was a bug, I'd be pretty suspicious about the general software quality in the rest of the library.
- pictur 5y agovery optimistic point of view.
- samwillis 5y agoThis is the same field that thought they could save a year as two digits and didn't think their software would still be in use 30 years later. It's not crap, it's just short sighted.
- larrik 5y agoTo be fair, in 1970 those 2 digits were very expensive. It was a calculated tradeoff at worst.
- cesarb 5y ago> To be fair, in 1970 those 2 digits were very expensive. More than just "very expensive". Often, you were limited to exactly 80 columns for each record. If you had for instance three dates on one record, using 2 digits instead of 4 digits saved 6 columns, which is over 7% of the available space.
- ethbr0 5y agoTrue, but user-agent was 1996(?). By then, we weren't talking about limited mainframe storage devices. It just baffles that someone can look at a monotonically increasing number, defined and incremented by a third party, and say "That will never be 3 digits."
- Beltalowda 5y agoI'd wager it's mostly fixed string indexes, regular expressions ("\d{2}"), and things like that. Maybe also some people with a "varchar(2)" column in the database. A lot of software is written by junior programmers, not infrequently in a hurry. It's an easy mistake to make and if you've been bitten by it once you'll remember it, but many people have never been bitten by it.
- skykooler 5y agoWell, keep in mind that major version numbers used to change slowly. In the first ten years Firefox existed, it went from version 0.1 to version 5.0. At that pace, it would have taken two hundred years to hit a three-digit major version. In my opinion, browser vendors brought this upon themselves by changing what "major version" meant.
- lmkg 5y agoI wouldn't be so confident that the code is coming from a library. We take code distribution for granted these days, but some fraction of the web today was built when the only way to get anything done was hand-rolled perl scripts.
- throwaway932489 5y ago"New dependencies need to be approved by xyz" "Ok" if(userAgent.includes("Chrome") && userAgent[whatever] >= 4)
- petercooper 5y agoI admit it's crap, but I once added a temporary fix to a system of mine that blocked clients with a user agent matching "Chrome 54" (at the string level) due to a bot (I know it's not ideal, but it worked in the moment, and genuine users were no longer using such an old version). I doubt Chrome 540 would turn up any time soon, but I can picture other folks having done similar things with "Chrome 12", say, and wondering why things fail with Chrome 120(!)
- glandium 5y agoThat's the speculated reason why Microsoft had to skip Windows 9: because in the late 90s, software were checking for «starts with "Windows 9"» to identify Windows 95 and 98... and some of those checks still exist and would had identified Windows 9 as Windows 95/98.
- Someone 5y agoI think you’ll find all kinds of ‘libraries’ for doing that, especially in small embedded devices with a web front-end. I also fear there’s software that correctly extracts all the digits of the version in the user agent, but then compares it as a string with a given version. That would get you “100” < “99”
- cpeterso 5y agoHere's a real example of that bug: Slack's message buttons (such as "Add reaction" or "Reply in thread") stopped working for Firefox versions >= 100 and <= 519. They mysteriously started working again for versions >= 520. The version string "100" compared as smaller than "52" in Slack's code, which activated some kind of webcompat workaround intended for Firefox versions < 52 that breaks on more recent Firefox versions. https://github.com/webcompat/web-bugs/issues/67866 https://github.com/webcompat/web-bugs/issues/67866