wikimedia-gadgets / afc-helper

A tool for reviewing Articles for Creation submissions on the English Wikipedia
https://en.wikipedia.org/wiki/Wikipedia:AFCH
GNU General Public License v3.0
37 stars 80 forks source link

Overwriting another reviewer's AFC accept/decline/comment (edit conflict avoidance) #153

Closed NovemLinguae closed 7 months ago

NovemLinguae commented 3 years ago

I had this happen today. It is possible to overwrite somebody else's AFC decline, if they finalize their decline while you're writing yours.

Possible solution: When the reviewer presses the decline button, have AFCH check the page history, and if there have been any edits within the last 10 minutes, give the reviewer a warning when submitting.

Possible solution # 2: When AFCH loads, save the current time. When the reviewer presses the decline button, have AFCH check the page history, and if there have been any edits since the saved time, notify the submitter of an edit conflict.

edit: Looks like it can happen with comments, too. And with one person accepting, one person commenting. So any combination of types is probably possible.

https://en.wikipedia.org/w/index.php?title=Draft:Jointed_Boiler_Locomotive&type=revision&diff=1009914671&oldid=1009913368&diffmode=source

NovemLinguae commented 3 years ago

Happened again to me just now. Here's an example.

https://en.wikipedia.org/w/index.php?title=Draft:Dhanusha_Murugasan&type=revision&diff=1013933947&oldid=1013933811&diffmode=source

And here's an interesting edge case. A decline after an accept. Which declines the redirect.

https://en.wikipedia.org/w/index.php?title=Draft:Tribal_Rage&diff=1016350965&oldid=1016350889&diffmode=source

primefac commented 3 years ago

This is a duplicate of #116

Dreamy-Jazz commented 3 years ago

With the latest AfC drive I've seen three editors edit conflict to review a draft and the script overwrite each in turn.

siddharthvp commented 2 years ago

What I would suggest is to check for new edits being made to the page every 5 or 10 seconds. If new changes are detected, show a notice saying "This draft has been recently edited N times by USERNAME. Reload to see the latest changes". Ideally, any half-written comment in the text box should be preserved across the reload.

The API call to do this is very cheap since we just have to fetch the metadata of newer revisions – not the content, and this will be empty most of the time.

Checking for conflict only when the user is actually accepting/declining wastes their time as they need not have done that if someone had already done so in the interim. This also handles the case of commenting conflicts.