= problem statement
When: I hit a desktop link while browsing with a mobile user agent
Expected: User sees Special:MobileDiff
Actual: User sees desktop diff page.
Certain URLs to diffs do not redirect on mobile devices.
[] When I visit [[ https://de.wikipedia.org/w/index.php?title=Skull&diff=164584307 | example url ]] I expect a redirect to occur taking me to [[ https://de.wikipedia.org/wiki/Special:MobileDiff/164584307 | the mobile url ]].
[] If diff is a number e.g. [[https://cs.wikipedia.org/w/index.php?title=MyPage&diff=14286854&oldid=14265839 | My Page last change]] then I should be redirected to [[ https://cs.m.wikipedia.org/wiki/Speci%C3%A1ln%C3%AD:Mobiln%C3%AD_rozd%C3%ADl/14265839...14286854 | the mobile url ]].
= Code
* The redirect is handled in MobileContext::redirectMobileEnabledPages
* The redirect only happens if diff is a provided in the query string parameter
* The redirect url is determined by SpecialMobileDiff::getMobileUrlFromDesktop();
** The redirect only applies if both diff and oldid are provided.
** If only oldid is provided without diff then the revision is shown.
= Developer notes
[] This should be fixable by simply updating SpecialMobileDiff::getMobileUrlFromDesktop(); with new test cases and making them green (https://gerrit.wikimedia.org/r/359060 Tests for diffs )
[] A little bit of debugging will be needed to see why the redirect doesn't happen when title query parameter is set but it seems to relate to getStopMobileRedirectCookie
= Testing
View https://de.wikipedia.org/w/index.php?title=Skull&diff=164584307 on a mobile device (or emulated Chrome Nexus 5)
Expected: user should be redirected to mobile site.