Page MenuHomePhabricator

Update API to see distinction between edits from a human and a bot
Open, LowPublicFeature

Description

Feature summary (what you would like to be able to do and where):
As an apps user I would like edits by user, IP and bots to be distinguished, so that I don't try to thank a bot and can easily tell which edits are from bots.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

  • When using the app and clicking the diff view and selecting the Thanks button from a user, I get an error message but no distinction in the UI that the edit is from a bot and not a regular user

Benefits (why should this be implemented?):
Create less confusion for app users and more parity for expected behavior that is seen on Desktop

More details
The apps aren't able to distinguish based on the existing API (prop=revisions) which revisions are bot edits.See T315382#8214899

Event Timeline

There's already a "tag" mechanism for edits, right? We already tag all edits from visualeditor, for example. For example, on https://en.wikipedia.org/w/index.php?title=User:Cscott&action=history I can see that the tags "2017 wikitext editor" and "Visual edit" have been applied to some of my most recent edits. I assume bot edits are/could be similarly tagged. And indeed https://en.wikipedia.org/wiki/Special:Tags shows a number of bot-related tags.

This is available via prop=revisions if you just add the tags option to rvprop, eg:
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=User%3Acscott&rvprop=ids%7Ctimestamp%7Ccomment%7Cuser%7Ctags&rvlimit=1
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=revisions&titles=User%3Acscott&rvprop=ids%7Ctimestamp%7Ccomment%7Cuser%7Ctags&rvlimit=100

We could do that, adding a generic "bot-edit" tag, though it'd be lacking in historical data unless we did some sort of backfill. Also available is doing a second API query to the list=users API for more information about the users obtained from your first API call -- all bots are supposed to be in the bot group. E.g. https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=users&titles=Talk%3AList%20of%20alternative%20shells%20for%20Windows&formatversion=2&usprop=groups&ususers=SineBot

prop=revisions does already include whether the user is anonymous, as well.

After @cscott suggestion it looks like a good way forward is to use the existing query with prop=revisions passing the extra arguments prop=contributors and pcgroup=bots so we get all the information with one request.

@Dbrant / @cooltey / @Sharvaniharan - thoughts on whether the extra arguments is good enough?

it looks like a good way forward is to use the existing query with prop=revisions passing the extra arguments prop=contributors and pcgroup=bots so we get all the information with one request.

I'm not sure we can combine the two API calls of prop=revisions and prop=contributors, since these two lists seem to be independent of each other, i.e. there's no guarantee that all the users listed in prop=revisions will appear in the list of contributors, so the call to get contributors must necessarily be made after the call to get revisions.

Looking again at this task, I believe the question may be simplified as follows:

When using the API to retrieve a list of edits to pages on my watchlist (list=watchlist) , I get a list of "edits" that includes the field bot=false/true. It also lets me filter the list by "bot / not bot" edits. If this functionality is available in list=watchlist, could it also be built into prop=revisions?