Page MenuHomePhabricator

Api returns the wrong timestamp for the date of latest edit of user talk pages
Closed, DeclinedPublic

Description

Right now, the API call
https://pt.wikipedia.org/w/api.php?action=query&prop=info&titles=User_talk:!Silent&format=jsonfm
returns
{

"query": {
    "normalized": [
        {
            "from": "User_talk:!Silent",
            "to": "Usu\u00e1rio Discuss\u00e3o:!Silent"
        }
    ],
    "pages": {
        "1618362": {
            "pageid": 1618362,
            "ns": 3,
            "title": "Usu\u00e1rio Discuss\u00e3o:!Silent",
            "contentmodel": "wikitext",
            "pagelanguage": "pt",
            "touched": "2013-11-01T23:39:57Z",
            "lastrevid": 37128640,
            "counter": "",
            "length": 62836
        }
    }
}

}
but according to
https://pt.wikipedia.org/wiki/User_talk:!Silent?action=info&uselang=en
the latest edit to this page was
https://pt.wikipedia.org/wiki/User_talk:!Silent?diff=37128640
and its timestamp is 2013-10-16T20:29:59.

The API should return the same timestamp shown in "action=info" (that is "2013-10-16T20:29:59"), which is the one corresponding to the "lastrevid" returned.


Version: unspecified
Severity: normal

Details

Reference
bz56540

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:34 AM
bzimport set Reference to bz56540.
bzimport added a subscriber: Unknown Object (MLST).

I think the 'touched' field corresponds to the page_touched database field, which is described as:

  • This timestamp is updated whenever the page changes in
  • a way requiring it to be re-rendered, invalidating caches.
  • Aside from editing this includes permission changes,
  • creation or deletion of linked pages, and alteration
  • of contained templates. page_touched binary(14) NOT NULL default '',

If I am indeed true, this should probably be documented on API docs as well.

If that is the case, this bug should be rephrased to request an additional property to be returned by the API (say "latestedit"), which would contains exactly the same timestamp which currently appears on action=info.

BTW: this problem was identified here:
https://pt.wikipedia.org/wiki/MediaWiki:Gadget-fastbuttons.js?diff=37236051#line-915

You simply need to ask for revisions as well as the page info, since you want information about the latest revision:

https://pt.wikipedia.org/w/api.php?action=query&prop=info|revisions&titles=User_talk:!Silent&format=jsonfm

The page entry will then contain an additional 'revision' key with the revision info, including the timestamp:

"revisions": [
    {
        "revid": 37128640,
        "parentid": 36978827,
        "user": "Stuckkey",
        "timestamp": "2013-10-16T20:29:59Z",
        "comment": "nova mensagem de WikiApre\u00e7o: /* Uma medalha! */"
    }
]

(In reply to comment #1)

If I am indeed [right]

Yes, you're right. Feel free to update the docs.