Page MenuHomePhabricator

Stop default redirecting Samsung Smart TVs to mobile web
Closed, ResolvedPublic

Description

Acceptance criteria

  • A forged UA of Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1 (specific value matching regex /SMART-TV.*SamsungBrowser/) does not get redirected to mobile
  • Product owner is notified, so product owner can update vendor

At the request of the vendor based on user feedback, the default redirect of Samsung Smart TVs to the mobile web should be removed.

UAs matching the regex /SMART-TV.*SamsungBrowser/ should not be redirected to the mobile website.

The current case insensitive regex for "samsung" at https://github.com/wikimedia/operations-puppet/blob/production/templates/varnish/text-frontend.inc.vcl.erb#L22, and https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/4f0db830a8c0e792b944836e201ce07dc47777e2/includes/DeviceDetection.php#L156 is overly broad in its detection/redirection. Likewise, the device detection unit tests probably need an additional test to expressly rule out the smart TVs).

For our future selves, eligible UAs can be identified with the following type of Hive query.

select user_agent, count(*)
from webrequest
where
year = 2016
and month = 2
and day = 14
and agent_type = 'user'
and is_pageview = true
and user_agent rlike 'SMART-TV.*SamsungBrowser'
group by user_agent;

Details

Related Gerrit Patches:
operations/puppet : productionDo not redirect Samsung Smart TV 2015 and newer to mobile
mediawiki/extensions/MobileFrontend : masterUpdate PHP rules to match VCL
mediawiki/extensions/MobileFrontend : masterDo not redirect Samsung TV browser to mobile site

Event Timeline

dr0ptp4kt raised the priority of this task from to Needs Triage.
dr0ptp4kt updated the task description. (Show Details)
dr0ptp4kt added a subscriber: dr0ptp4kt.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 15 2016, 11:31 PM
dr0ptp4kt updated the task description. (Show Details)Feb 15 2016, 11:34 PM
dr0ptp4kt set Security to None.
dr0ptp4kt updated the task description. (Show Details)
Jdlrobson triaged this task as Low priority.Feb 16 2016, 7:03 PM
Jdlrobson added a subscriber: Jdlrobson.
Jdlrobson moved this task from Backlog to Bugs on the MobileFrontend board.Feb 18 2016, 6:24 PM
bmansurov updated the task description. (Show Details)Feb 19 2016, 6:18 PM

According to the "Samsung Internet for Smart-TV User-Agent String Format" section of http://developer.samsung.com/technical-doc/view.do?v=T000000203 we may want to consider another regex. Do we want to do so, or is just enough to redirect the 2015 model for now, @dr0ptp4kt?

bmansurov changed the task status from Open to Stalled.Mar 17 2016, 7:58 PM
bmansurov removed bmansurov as the assignee of this task.Mar 17 2016, 8:52 PM
bmansurov added a subscriber: bmansurov.

It's for 2015 and above (which is presently only 2016). The regex above captures both.

We can generalize further if another request is made for it, but let's keep it confined to just this for now.

Change 278408 had a related patch set uploaded (by Bmansurov):
Do not redirect Samsung TV browser to mobile site

https://gerrit.wikimedia.org/r/278408

Change 278408 abandoned by Bmansurov:
Do not redirect Samsung TV browser to mobile site

Reason:
Resurrect if needed.

https://gerrit.wikimedia.org/r/278408

Change 281031 had a related patch set uploaded (by Bmansurov):
Do not redirect Samsung Smart TV 2015 and newer to mobile

https://gerrit.wikimedia.org/r/281031

I've reviewed the change and it looks OK to me /cc @BBlack

Change 281031 merged by BBlack:
Do not redirect Samsung Smart TV 2015 and newer to mobile

https://gerrit.wikimedia.org/r/281031

Change 282826 had a related patch set uploaded (by MaxSem):
Update PHP rules to match VCL

https://gerrit.wikimedia.org/r/282826

phuedx changed the task status from Stalled to Open.Apr 12 2016, 8:35 AM

Change 282826 merged by jenkins-bot:
Update PHP rules to match VCL

https://gerrit.wikimedia.org/r/282826

Jdlrobson added a comment.EditedApr 13 2016, 6:11 PM

@dr0ptp4kt can you sign off? I tried forging the user agent given and I'm still on desktop site, so I guess this is done but not sure if there are other user agents to test.

dr0ptp4kt closed this task as Resolved.Apr 14 2016, 4:26 AM
dr0ptp4kt claimed this task.
dr0ptp4kt updated the task description. (Show Details)

@Jdlrobson, yep, thanks for checking. Just one additional UA beyond that in the description at the moment, based on a query in Hive on 20160413 data.

Signing off.

General Samsung mobile case: 302 from desktop to mobile

$ $ curl -v -A "Samsung" https://en.wikipedia.org/wiki/Main_Page
*   Trying 198.35.26.96...
* Connected to en.wikipedia.org (198.35.26.96) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.wikipedia.org
* Server certificate: GlobalSign Organization Validation CA - SHA256 - G2
* Server certificate: GlobalSign Root CA
> GET /wiki/Main_Page HTTP/1.1
> Host: en.wikipedia.org
> User-Agent: Samsung
> Accept: */*
> 
< HTTP/1.1 302 Found
< Date: Thu, 14 Apr 2016 04:16:11 GMT
< Content-Length: 0
< Connection: keep-alive
< Server: Varnish
< Location: https://en.m.wikipedia.org/wiki/Main_Page

Samsung TV use case 1 of 2 covered by patch using UAs identified 20160403 with Hive query in Description: 200 on desktop

$ curl -v -A "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1" https://en.wikipedia.org/wiki/Main_Page
*   Trying 198.35.26.96...
* Connected to en.wikipedia.org (198.35.26.96) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.wikipedia.org
* Server certificate: GlobalSign Organization Validation CA - SHA256 - G2
* Server certificate: GlobalSign Root CA
> GET /wiki/Main_Page HTTP/1.1
> Host: en.wikipedia.org
> User-Agent: Mozilla/5.0 (SMART-TV; Linux; Tizen 2.3) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.0 TV Safari/538.1
> Accept: */*
> 
< HTTP/1.1 200 OK

Samsung TV use case 2 of 2 covered by patch using UAs identified 20160403 with Hive query in Description: 200 on desktop

$ curl -v -A "Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.1 TV Safari/538.1" https://en.wikipedia.org/wiki/Main_Page
*   Trying 198.35.26.96...
* Connected to en.wikipedia.org (198.35.26.96) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.wikipedia.org
* Server certificate: GlobalSign Organization Validation CA - SHA256 - G2
* Server certificate: GlobalSign Root CA
> GET /wiki/Main_Page HTTP/1.1
> Host: en.wikipedia.org
> User-Agent: Mozilla/5.0 (SMART-TV; Linux; Tizen 2.4.0) AppleWebkit/538.1 (KHTML, like Gecko) SamsungBrowser/1.1 TV Safari/538.1
> Accept: */*
> 
< HTTP/1.1 200 OK
Restricted Application added a project: Operations. · View Herald TranscriptMay 4 2016, 9:13 AM