Page MenuHomePhabricator

Mobile REST API does not (always) deliver HTML for latest revid
Open, Needs TriagePublic

Description

Mobile REST API call:

$curl -s https://en.wiktionary.org/api/rest_v1/page/mobile-sections/rocker | jq | grep revision
    "revision": "52542455",

which is a revision of April 2019

Standard HTML REST API call:

$ curl -s https://en.wiktionary.org/api/rest_v1/page/html/rocker | grep revision
<html prefix="dc: http://purl.org/dc/terms/ mw: http://mediawiki.org/rdf/" about="https://en.wiktionary.org/wiki/Special:Redirect/revision/61774146"><head prefix="mwr: https://en.wiktionary.org/wiki/Special:Redirect/"><meta property="mw:TimeUuid" content="f74ed480-6954-11eb-b395-7bbda64f2d61"/><meta charset="utf-8"/><meta property="mw:pageId" content="223755"/><meta property="mw:pageNamespace" content="0"/><link rel="dc:replaces" resource="mwr:revision/61659965"/><meta property="mw:revisionSHA1" content="26eab9753486198f17b6169d978f39bd3ed19506"/><meta property="dc:modified" content="2021-02-07T14:58:36.000Z"/><meta property="mw:html:version" content="2.2.0"/><link rel="dc:isVersionOf" href="//en.wiktionary.org/wiki/rocker"/><title>rocker</title><base href="//en.wiktionary.org/wiki/"/><link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=mediawiki.skinning.content.parsoid%7Cmediawiki.skinning.interface%7Csite.styles&amp;only=styles&amp;skin=vector"/><meta http-equiv="content-language" content="en"/><meta http-equiv="vary" content="Accept"/></head><body id="mwAA" lang="en" class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki mw-parser-output" dir="ltr"><section data-mw-section-id="0" id="mwAQ"><div class="disambig-see-also" about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"also","href":"./Template:also"},"params":{"1":{"wt":"Rocker"}},"i":0}}]}' id="mwAg"><i>See also:</i> <b class="Latn"><a rel="mw:WikiLink" href="./Rocker" title="Rocker">Rocker</a></b></div>

Wich is the proper latest revision of February 2020.

Both call should return the content corresponding to the same latest revision, here 61774146

But first reported for MWoffliner at https://github.com/openzim/mwoffliner/issues/1397

Event Timeline

Getting the same thing on enwiki, try https://en.wikipedia.org/api/rest_v1/page/mobile-html/Wikipedia:Administrators'_noticeboard%2FIncidents

As of this writing, I get a revision from September 2020.

This prevented me (and I assume, other users) from commenting at that page using the official Wikipedia Android app.

Hi @Kelson Has this problem been solved? It would be fantastic to have zim file with up-to-date content in the next release.

Hi @Kelson Has this problem been solved?

No.

$ curl -s https://en.wiktionary.org/api/rest_v1/page/mobile-sections/rocker | jq | grep revision
    "revision": "52542455",

Getting the same thing on enwiki, try https://en.wikipedia.org/api/rest_v1/page/mobile-html/Wikipedia:Administrators'_noticeboard%2FIncidents

As of this writing, I get a revision from September 2020.

This prevented me (and I assume, other users) from commenting at that page using the official Wikipedia Android app.

Just (re-) surfacing this - I've likely duplicated this report at T292330.

Could I be a pain and ask if there's any movement on this issue?

Samtar renamed this task from (Wiktionary) Mobile REST API does not (always) deliver HTML for latest revid to Mobile REST API does not (always) deliver HTML for latest revid.Sun, Oct 3, 12:04 AM

I've spent a bit of time debugging this (initially from the Android app side, but this does just seem to be upstream of it) - directly calling the latest revision ID correctly returns the expected data:

https://en.wikipedia.org/api/rest_v1/page/mobile-html/Wikipedia:Administrators'_noticeboard%2FIncidents/1048089227

@Samtar Not that I'm aware of... and this is a pretty annoying one. We regularly have users (at Kiwix) complaining because of an old revision of an article because the REST API cache is not refreshed properly.