Page MenuHomePhabricator

API logevents/recentchanges entries for revdel logs are weird
Closed, ResolvedPublic

Description

http://en.wiktionary.org/w/api.php?action=query&continue=-||&rccontinue=20150329071532|32640824&list=recentchanges&rclimit=1&rcprop=loginfo

{
  "type": "log",
  "logid": 30374103,
  "logtype": "delete",
  "logaction": "revision",
  "0": "revision",        // string
  "1": "32338586",
  "2": 0,                 // int
  "3": 1
}

I found it only in en.wiktionary API.

I'd like to know whether it works as intended or it is something exceptional.

Event Timeline

LinJin raised the priority of this task from to Needs Triage.
LinJin updated the task description. (Show Details)
LinJin subscribed.

Think it probably applies to all revision deletion entries.

The response is different:
http://en.wikiquote.org/w/api.php?action=query&list=logevents&leaction=delete/revision&lelimit=1

{
    "logid": 2083563,
    "ns": 0,
    "title": "Upbuilding Discourses in Various Spirits",
    "pageid": 164974,
    "logpage": 164974,
    "0": "revision",
    "1": "1851213",
    "2": "ofield=0",
    "3": "nfield=1", // string
    "type": "delete",
    "action": "revision",
    "user": "Mdd",
    "timestamp": "2015-02-16T15:51:15Z",
    "comment": "Copyright violation: Test edit to determine limit of quotation status - this version can be compared to the original"
}

where the "2" and "3" params are strings, the problem is that the field has different types.

Trivial to reproduce this output locally as well - simply revdel something, and view api.php?action=query&list=logevents&leaction=delete/revision&lelimit=1 or api.php?action=query&list=recentchanges&rcprop=loginfo&rclimit=1. So this is not some weird site-specific thing.

Krenair renamed this task from Log params returned by JSON API have different types. to API logevents/recentchanges entries for revdel logs are weird.Mar 30 2015, 12:01 PM

The description here doesn't explain things well at all. Is the problem that some log entries are having "ofield=0" as a string while others are having just 0 as an integer? If so, it's probably fallout from Gerrit change 152161, which screwed around with the logging format for revdel while trying to maintain BC with the rather useless formatting of old log entries from the API.

Gerrit change 183315 (T35235) should fix this sort of thing, although it will be a BC break.

Change 200632 had a related patch set uploaded (by Umherirrender):
Fix list=logevents for new revision delete log entries

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

Change 200632 merged by jenkins-bot:
Fix list=logevents for new revision delete log entries

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

When will the change take effect?

When your wiki's admins update their copy of MediaWiki to a version which includes this patch?