Page MenuHomePhabricator

Curator gets reverted edits count
Open, MediumPublic


"As a Curator, I want to get a count of reverted edits of a page, so that... (I can understand the amount of vandalism to the page?)."

GET /page/{title}/history/counts/reverted

Return summary of information in the edit history.

Request body: none

Notable request headers: none
Status codes:
200 - OK
404 - no such page

Notable response headers: none

Body: JSON, object with following fields
count: total number of reverted edits (TBD)

Event Timeline

daniel added a subscriber: daniel.EditedAug 30 2019, 2:00 PM

Note that there is no efficient way to compute this number. That would at least require having an index on (page_id, rev_sha1). Even with that index, the necessary self-join may be too expensive. We could also try to detect reverts by iterating through the history programmatically, but for pages with a very long history, that may also not be feasible. We may have to with a compromise like "number of reverts within the last 500 revisions" or some such. Or "number of reverts in the last 30 days", based on recentchanges flags.

eprodromou triaged this task as Medium priority.Oct 2 2019, 10:12 PM
eprodromou updated the task description. (Show Details)
eprodromou updated the task description. (Show Details)Oct 11 2019, 7:51 PM

Changed revertededits to reverted.

eprodromou updated the task description. (Show Details)Oct 11 2019, 7:52 PM

This seems to be working correctly, but I think there might be some subtle bugs. My guess is if it's doing the same queries as T231355, it's going to get the right count most of the time, since the count of reverting revisions is usually going to be the same as the count of reverted revisions (unless there are cases where more than one revision reverts an older revision, or one revision reverts more than one older revision...?). The only way I could see them being not equal is if one or the other of the pair was deleted.

eprodromou updated the task description. (Show Details)Oct 24 2019, 5:30 PM
eprodromou updated the task description. (Show Details)Nov 6 2019, 5:54 PM