Repro Steps
Run this command a number of times and observe the title of the page in the output. Using only the title here for simplicity, the whole page has the same problem.
curl -sv -H "Accept-Language: zh-hant" -H "Cache-Control: no-cache" https://zh.wikipedia.org/api/rest_v1/page/mobile-html/2019%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92%E7%97%85%E7%96%AB%E6%83%85 | egrep -ohi '(?:<h1 data-id="0" class="pcs-edit-section-title">)[^<]+'
Expected results
The language is zh-hant every time
Actual results
Sometimes the language is zh-hans
Here's an example request with the correct variant (only including the relevant headers):
> GET /api/rest_v1/page/mobile-html/2019%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92%E7%97%85%E7%96%AB%E6%83%85 HTTP/2 > Host: zh.wikipedia.org > User-Agent: curl/7.64.1 > Accept: */* > Accept-Language: zh-hant > Cache-Control: no-cache ... < content-type: text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/Mobile-HTML/1.2.1" < vary: Accept-Language, Accept-Encoding < content-language: zh-hant < date: Tue, 07 Apr 2020 11:48:05 GMT < cache-control: s-maxage=1209600, max-age=0, must-revalidate < access-control-allow-methods: GET,HEAD < referrer-policy: origin-when-cross-origin < content-location: https://zh.wikipedia.org/api/rest_v1/page/mobile-html/2019%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92%E7%97%85%E7%96%AB%E6%83%85 < x-request-id: 73184458-76e5-47bc-bb1d-38167a6a2a30 < server: restbase1027 < etag: W/"59036991/a46ba570-78c5-11ea-8284-a649b8c658ff" < age: 4 < x-cache: cp1081 miss, cp1087 pass < x-cache-status: pass < server-timing: cache;desc="pass" < strict-transport-security: max-age=106384710; includeSubDomains; preload
And one with the incorrect variant:
> GET /api/rest_v1/page/mobile-html/2019%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92%E7%97%85%E7%96%AB%E6%83%85 HTTP/2 > Host: zh.wikipedia.org > User-Agent: curl/7.64.1 > Accept: */* > Accept-Language: zh-hant > Cache-Control: no-cache ... < content-type: text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/Mobile-HTML/1.2.1" < vary: Accept-Language, Accept-Encoding < content-language: zh < date: Tue, 07 Apr 2020 11:45:34 GMT < cache-control: s-maxage=1209600, max-age=0, must-revalidate < access-control-allow-methods: GET,HEAD < referrer-policy: origin-when-cross-origin < content-location: https://zh.wikipedia.org/api/rest_v1/page/mobile-html/2019%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92%E7%97%85%E7%96%AB%E6%83%85 < x-request-id: 889b90a3-29de-4f8b-9589-296275b69a99 < server: restbase1020 < etag: W/"59036991/4af063a0-78c5-11ea-a66a-a2018dda4efe" < age: 7 < x-cache: cp1083 miss, cp1087 pass < x-cache-status: pass < server-timing: cache;desc="pass" < strict-transport-security: max-age=106384710; includeSubDomains; preload
When running it against the mobileapps service labs instance, I see the correct title every time:
curl -sv -H "Accept-Language: zh-hant" -H "Cache-Control: no-cache" https://mobileapps.wmflabs.org/zh.wikipedia.org/v1/page/mobile-html/2019%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92%E7%97%85%E7%96%AB%E6%83%85 | egrep -ohi '(?:<h1 data-id="0" class="pcs-edit-section-title">)[^<]+'
Additional info
I'm seeing the same problem on mobile-sections-lead, so it appears the issue is not limited to mobile-html:
curl -sv -H "Accept-Language: zh-hant" -H "Cache-Control: no-cache" https://zh.wikipedia.org/api/rest_v1/page/mobile-sections-lead/2019%E5%86%A0%E7%8A%B6%E7%97%85%E6%AF%92%E7%97%85%E7%96%AB%E6%83%85 | egrep -ohi '"displaytitle":"[^"]+"'
Original bug report:
This can be reproduced on the Wikipedia Android beta app.
Please note that this issue does not happen on every zh.wiki articles.
Steps to reproduce
- Open article: 嚴重特殊傳染性肺炎疫情 in Traditional Chinese
- Refresh the page after it's fully loaded.
- You will see the article's variant is changed which includes the article content, ToC data, and footer.