Page MenuHomePhabricator

Inconsistent normalization of special page names when using prop=revisions with redirect resolution
Open, Needs TriagePublicBUG REPORT

Description

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

Context: on frwiki, Wikipédia:Messages prédéfinis de Wikipédia is a redirect to [[Special:Allmessages]]. In French, the localized name of "Special:Allmessages" is "Spécial:Messages système".

Try to use prop=revisions on this redirect: https://fr.wikipedia.org/w/api.php?action=query&prop=revisions&redirects=1&rvprop=flags&rvslots=main&titles=Wikip%C3%A9dia%3AMessages%20pr%C3%A9d%C3%A9finis%20de%20Wikip%C3%A9dia&utf8=

What happens?:

The response is:

{
    "batchcomplete": "",
    "query": {
        "redirects": [
            {
                "from": "Wikipédia:Messages prédéfinis de Wikipédia",
                "to": "Spécial:Allmessages"
            }
        ],
        "pages": {
            "-1": {
                "ns": -1,
                "title": "Spécial:Messages système",
                "special": ""
            }
        }
    }
}
  • In the "redirects" section, "to" contains a partially normalized page name ("Special" is changed to "Spécial" but "Allmessages", but "Allmessages" is not localized and remains "Allmessages")
  • In the "pages" section, "title" contains the localized special page name ("Spécial:Messages système").

Of course, if only one page is read at once, the program could assume that the only page in the "pages" section is the target of the redirect. However, when requesting multiple pages at once, it becomes impossible to reliably match entries in "pages" to the requested titles. Example with two pages: "Wikipédia:Messages prédéfinis de Wikipédia" + "Wikipédia:NP".

What should have happened instead?:

The name of the page in the "to" attribute in the "redirects" section should always match the "title" attribute of an entry in the "pages" section (it should be "Spécial:Messages système" in both cases).

Context: I'm not really interested in reading special pages, as they don't have proper revisions anyway. I ran into this problem because I am trying to read multiple redirects simultaneously, and one of them happens to point to a special page. This broke the matching that my bot tries to do between "redirects" and "pages" in its generic function to read multiple pages.