Page MenuHomePhabricator

API query list=watchlist and wlprop=unread returns spurious artiffacts
Closed, ResolvedPublic

Description

it's a bit complicated to describe, but i'll try:

running this api call:

{ action: "query", list: "watchlist", wlshow: "unread" }

should return the watchlist items this user did not visit since they were last changed.

the problem is that occasionally, relatively old changes, in pages the user *did* visit since, appear in the list of returned values.

one interesting fact is that for those items, the "timestamp" and "notificationtimestamp" values are not the same, and furthermore, notificationtimestamp is *newer* than timestamp

here is a live example:
api call:
https://he.wikipedia.org/w/api.php?action=query&list=watchlist&wlshow=unread&wlprop=timestamp|notificationtimestamp|title

returned

{
    "batchcomplete": "",
    "query": {
        "watchlist": [
            {
                "type": "edit",
                "ns": 3,
                "title": "\u05e9\u05d9\u05d7\u05ea \u05de\u05e9\u05ea\u05de\u05e9:\u05e2\u05e8\u05df",
                "timestamp": "2016-02-03T22:13:22Z",
                "notificationtimestamp": "2016-02-03T22:13:22Z"
            },
            {
                "type": "edit",
                "ns": 10,
                "title": "\u05ea\u05d1\u05e0\u05d9\u05ea:\u05d0\u05ea\u05e8 \u05de\u05d5\u05e8\u05e9\u05ea \u05e2\u05d5\u05dc\u05de\u05d9\u05ea",
                "timestamp": "2016-01-20T03:05:30Z",
                "notificationtimestamp": "2016-02-03T21:44:08Z"
            }
        ]
    }
}

note that for the 2nd record, "timestamp" is 2016-01-20T03:05:30Z, which matches the top entry in the page history, but notificationtimestamp is 2016-02-03T21:44:08Z. there is nothing in the page history or the logs that indicate anything that happened on this time.

opening the watchlist page (not using API), shows the Jan 20 entry not in boldface.

this problem makes the "wlshow=unread" practically useless, which is a pity.

peace.

Details

Related Gerrit Patches:

Event Timeline

Kipod created this task.Feb 3 2016, 10:58 PM
Kipod raised the priority of this task from to Needs Triage.
Kipod updated the task description. (Show Details)
Kipod added a project: MediaWiki-API.
Kipod added a subscriber: Kipod.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 3 2016, 10:58 PM
Kipod updated the task description. (Show Details)Feb 3 2016, 11:00 PM
Kipod set Security to None.
Schnark added a subscriber: Schnark.Feb 4 2016, 8:57 AM

The change that updated the notification timestamp was on Wikidata: https://www.wikidata.org/w/index.php?title=Q5896997&action=history As this could have changed the page on he.wikipedia marking the page as unread is IMHO the correct behavior.

Anomie claimed this task.Feb 4 2016, 2:42 PM
Anomie added a subscriber: Anomie.

The watchlist module's wlshow=unread is filtering it to all revisions from pages with at least one unread revision, which in retrospect does seem to be unexpected here versus showing just the unread revisions.

Change 268395 had a related patch set uploaded (by Anomie):
ApiQueryWatchlist: wlshow=unread should filter revisions, not pages

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

Anomie moved this task from Unsorted to Needs Review on the MediaWiki-API board.Feb 4 2016, 2:45 PM
Kipod added a comment.Feb 4 2016, 4:36 PM

if i understand correctly, this really means that there was a change on wikidata that triggered this.

the user (that would be me), has the "wikibase-watchlist-show-changes-pref" (aka wlshowwikibase) flag set in preferences.

despite this preference, i did _not_ see this wikidata change in the watchlist.
not sure if this is a bug, or maybe i do not understand what this flag means.

peace.

Anomie added a comment.Feb 4 2016, 4:40 PM

Wikidata probably doesn't have anything to do with it besides that it might have caused the page as a whole to have unread changes.

If there is a Wikidata change, it should show up as its own record in the output, but you have to include external in wltype to see it as it's not included by default.

Change 268395 merged by jenkins-bot:
ApiQueryWatchlist: wlshow=unread should filter revisions, not pages

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

Anomie closed this task as Resolved.Feb 18 2016, 6:52 PM

This should be deployed to WMF wikis with 1.27.0-wmf.15.