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 created this task.Mar 30 2015, 3:07 AM
LinJin updated the task description. (Show Details)
LinJin raised the priority of this task from to Needs Triage.
LinJin added a project: Wiktionary.
LinJin added a subscriber: LinJin.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 30 2015, 3:07 AM
Krenair set Security to None.
Krenair added a subscriber: Umherirrender.

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.

Krenair added a comment.EditedMar 30 2015, 8:49 AM

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
Anomie added a subscriber: Anomie.Mar 30 2015, 2:22 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

Any remaining issues here?

LinJin added a comment.Apr 7 2015, 8:05 AM

When will the change take effect?

Krenair added a comment.EditedApr 7 2015, 8:06 AM

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

Umherirrender closed this task as Resolved.Apr 7 2015, 8:13 AM