Page MenuHomePhabricator

Watchlist feed api filtering parameters don't work
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
In all cases the feed is the same.

What should have happened instead?:
The feeds with filtering parameters should have shown nothing, as no edits matched the filters.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
Also fails through ApiSandbox. The hours= parameter seems to work fine, but the others have no (discernable) effect.


https://en.wikipedia.org/w/api.php?action=help&modules=feedwatchlist

Event Timeline

Noting that there is the hours limit, and it defaults to 24...

What pages are you expecting?

And similarly, the URLs in the description won't be very useful to see the current snapshot after a bit of time has passed.

What pages are you expecting?

I was expecting not to see edits by users (in the case of wlshow=bot) or edits at all (in the case of wltype=categorize).

And similarly, the URLs in the description won't be very useful to see the current snapshot after a bit of time has passed.

That shouldn't matter, VPT is edited frequently enough that it will always have an edit within the last 24 hours.

What I see right now, for all 3 links, is

image.png (416×1 px, 58 KB)

matmarex subscribed.

This is because the API module forwards its parameters to another API module, and the forwarding code doesn't handle array-like parameters correctly.

(I had this at the top of my mind by luck, because I remembered reading this code recently: https://gerrit.wikimedia.org/g/mediawiki/extensions/DiscussionTools/+/ebc884e2176a66fafb2ca3c432408b0c264ac37f/includes/ApiDiscussionToolsEdit.php#207)

Change #1015581 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] ApiFeedWatchlist: Fix handling of array parameters

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

This is because the API module forwards its parameters to another API module, and the forwarding code doesn't handle array-like parameters correctly.

(I had this at the top of my mind by luck, because I remembered reading this code recently: https://gerrit.wikimedia.org/g/mediawiki/extensions/DiscussionTools/+/ebc884e2176a66fafb2ca3c432408b0c264ac37f/includes/ApiDiscussionToolsEdit.php#207)

OOI, do we know how long this may have been broken? Just thinking about backporting it...

I'm not sure if it ever worked. The code hasn't changed since it was added, but maybe something changes in the parsing of API parameters that broke it. Blaming the lines shows it has been introduced in MW 1.22 in 2013, I'm not figuring out how to install that version to check :)