Page MenuHomePhabricator

Parse User-Agent strings with OS like "Windows 7" correctly into the user agent map {hawk}
Closed, DeclinedPublic8 Estimated Story Points

Description

Today, a User-Agent string like "... Windows 7 ..." is parsed into user_agent_map['os_family'] = 'Windows 7' and user_agent_map['os_major'] = '-'.
Shouldn't it be like: user_agent_map['os_family'] = 'Windows' and user_agent_map['os_major'] = '7'?

Event Timeline

needs a user-agent upgrade, can check on the UA Parser github page

Milimetric triaged this task as Medium priority.Feb 18 2016, 6:25 PM
Milimetric moved this task from Incoming to Event Platform on the Analytics board.
Milimetric moved this task from Event Platform to Analytics Query Service on the Analytics board.
Nuria subscribed.

Moving to kanban so this task is up for grabs as it is not so big.

Milimetric set the point value for this task to 8.Mar 3 2016, 5:33 PM

Microsoft claims that the right User agent string for Windows 7 is something like "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)". See - https://msdn.microsoft.com/en-us/library/hh920767(v=vs.85).aspx

Windows NT 6.1 denotes Windows 7 and Windows NT 6.2 denotes Windows 8 So my guess is if a UA string has "Windows 7" in it - it is not probably not a real browser request?

However even if the string is Windows NT 6.1 or 6.2 UA parser doesn't set OS Major - and I wonder if this is expected behavior because windows OS-es have in the past been Windows ME, XP, Vista and those wouldn't be set in OS Major. So may be we shouldn't bother fixing this behavior?

@madhuvishy
This seems correct, you're right. I agree we should leave it as it is.

Nevertheless, my point was: in the case of Windows 7 it would seem logic to me to have os_family be Windows instead of Windows 7, and have os_major be 7 instead of -. I'd say that the UA parser is not taking advantage of the os_major field for Windows systems.

It will be good to take the opportunity of having looked into this to upgrade ua parser if proceeds.

We decide to use UA-parser convention which is to separate major version version of windows (like Win7, winXP, win95 for instance) into OS families.