Page MenuHomePhabricator

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


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:|notificationtimestamp|title


    "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.


Event Timeline

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.
Kipod set Security to None.

The change that updated the notification timestamp was on Wikidata: As this could have changed the page on he.wikipedia marking the page as unread is IMHO the correct behavior.

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

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.


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

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