Last modified: 2013-11-04 16:49:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58540, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56540 - Api returns the wrong timestamp for the date of latest edit of user talk pages
Api returns the wrong timestamp for the date of latest edit of user talk pages
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-03 16:39 UTC by Helder
Modified: 2013-11-04 16:49 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2013-11-03 16:39:45 UTC
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.
Comment 1 Bartosz Dziewoński 2013-11-03 16:45:34 UTC
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.
Comment 2 Bartosz Dziewoński 2013-11-03 16:45:47 UTC
s/true/right/
Comment 3 Helder 2013-11-03 16:53:52 UTC
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
Comment 4 Brion Vibber 2013-11-03 18:33:15 UTC
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! */"
                    }
                ]
Comment 5 Brad Jorsch 2013-11-04 16:49:51 UTC
(In reply to comment #1)
> If I am indeed [right]

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links