Page MenuHomePhabricator

/page/summary/ and /page/mobile-html/ do not get the latest article description in zhwiki
Open, MediumPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
Both page/summary and page/mobile-html are not showing the latest description.

What should have happened instead?:
Should show the latest description "2023年台灣公視電視劇系列" in Wikidata.

Event Timeline

MSantos triaged this task as Medium priority.Aug 3 2023, 2:06 PM
MSantos edited projects, added Page Content Service; removed Content-Transform-Team.

I wonder if this would work if you used Accept-Language: zh-hant-tw instead of zh-tw? Both ought to be valid, but the former is the "more correct" BCP-47 code.

Hi @cscott,

It does not work if I apply Accept-Language: zh-hant-tw when requesting the APIs.

@Dbrant helped to purge the page (八尺門的辯護人) today and the issue is still there, we can confirm that it is not a cache issue.

Found the root cause of the issue:

Related to this ticket: T327379

The description in wikidata is still using the old language code, for example, the Chinese (Taiwan) is zh-tw, but the new mapping json has zh-TW, which is uppercase on the TW.
https://github.com/wikimedia/mediawiki-services-mobileapps/commit/73ada17fe18e0d3c770b9eaf1b7c4f75b03f3fbe

This will cause an error when trying to make a request for the code in the mwapi.getMetadataForSummary, and it will return multiple descriptions.

https://www.wikidata.org/w/api.php?format=json&formatversion=2&errorformat=html&errorsuselocal=1&action=wbgetentities&props=descriptions&titles=%E5%85%AB%E5%B0%BA%E9%96%80%E7%9A%84%E8%BE%AF%E8%AD%B7%E4%BA%BA&sites=zhwiki&languages=zh-TW

vs

https://www.wikidata.org/w/api.php?format=json&formatversion=2&errorformat=html&errorsuselocal=1&action=wbgetentities&props=descriptions&titles=%E5%85%AB%E5%B0%BA%E9%96%80%E7%9A%84%E8%BE%AF%E8%AD%B7%E4%BA%BA&sites=zhwiki&languages=zh-tw

cc @Jgiannelos

(I am still trying to fix it but if it looks like an easy fix for you, please help to advise, thanks!)

Change #1017960 had a related patch set uploaded (by Cooltey; author: Cooltey):

[mediawiki/services/mobileapps@master] Make language codes lowercase to catch description from Wikidata description correctly

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

Change #1017960 merged by jenkins-bot:

[mediawiki/services/mobileapps@master] Make language codes lowercase to catch description from Wikidata description correctly

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

The app is sending BCP47 language code to the endpoints:

For Chinese (Taiwan) is:
zh-Hant-TW, but the wikidata only accepts the old one: zh-tw.

Steps to reproduce:
add Accept-Language: zh-tw or Accept-Language: zh-Hant-TW when requesting https://zh.wikipedia.org/api/rest_v1/page/mobile-html/不夠善良的我們

to see the difference.

This is going to be revisited after PCS is completely migrated away from RB