Page MenuHomePhabricator

Patrol logevents return strings for revision ids sometimes
Closed, ResolvedPublic

Description

The query+logevents return the previous id and patrolled id sometimes as ints and sometimes as strings. It would be probably better when it always returns ints. In case the output changes here the current state:

{
    […]
    "query": {
        "logevents": [
            {
                "logid": 66911613,
                "ns": 1,
                "title": "Talk:Phonon.in",
                "pageid": 46899833,
                "logpage": 46899833,
                "params": {
                    "curid": "665622976",
                    "previd": "0"
                },
                "type": "patrol",
                "action": "patrol",
                "user": "Joseph2302",
                "timestamp": "2015-06-06T11:34:36Z",
                "comment": ""
            },
            {
                "logid": 66911612,
                "ns": 0,
                "title": "MTPA (disambiguation)",
                "pageid": 46907069,
                "logpage": 46907069,
                "params": {
                    "curid": 665746255,
                    "previd": 0,
                    "auto": ""
                },
                "type": "patrol",
                "action": "patrol",
                "user": "RussBot",
                "timestamp": "2015-06-06T11:34:35Z",
                "comment": ""
            }
        ]
    }
}

Maybe it had something to do whether the page was moved or not. This is at least the case here and the ids all point toward the new page and not Talk:Phonon.in (although the revision existed before the move). But that might be a coincidence and I haven't done specific tests regarding that.

Event Timeline

XZise created this task.Jun 6 2015, 11:59 AM
XZise raised the priority of this task from to Needs Triage.
XZise updated the task description. (Show Details)
XZise added a project: MediaWiki-API.
XZise added subscribers: XZise, jayvdb.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 6 2015, 11:59 AM
Anomie added a subscriber: Anomie.Jun 6 2015, 12:16 PM

Maybe it had something to do whether the page was moved or not. This is at least the case here and the ids all point toward the new page and not Talk:Phonon.in (although the revision existed before the move). But that might be a coincidence and I haven't done specific tests regarding that.

My guess would be autopatrol (where the RC entry being patrolled was directly created) versus patrolling after the fact (where the RC entry being patrolled was loaded from the database). For the former the rc_this_oldid and rc_last_oldid fields are likely to have been initialized as integers, while for the latter the database is returning the numbers as strings to avoid potential issues when returning a 64-bit integer field on a 32-bit machine. PHP mostly doesn't care, but JSON serializing is a place where it does.

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.Jun 6 2015, 12:20 PM

Change 216411 had a related patch set uploaded (by Anomie):
PatrolLogFormatter: Tag curid and previd as numbers for API

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

Umherirrender closed this task as Resolved.Jun 6 2015, 6:36 PM
Umherirrender claimed this task.
Umherirrender reassigned this task from Umherirrender to Anomie.
Umherirrender set Security to None.

Change 216411 merged by jenkins-bot:
PatrolLogFormatter: Tag curid and previd as numbers for API

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