New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overwriting another reviewer's AFC accept/decline/comment (edit conflict avoidance) #153
Comments
Happened again to me just now. Here's an example. And here's an interesting edge case. A decline after an accept. Which declines the redirect. |
This is a duplicate of #116 |
With the latest AfC drive I've seen three editors edit conflict to review a draft and the script overwrite each in turn. |
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. |
- Only checks handleComment for now. Once we figure out a good approach in code review, will expand this to handleAccept, handleDecline, and handleReject in a future patch. - Only checks when the submit button is clicked, to avoid spamming the Wikimedia API. - When an edit conflict is detected, hides the submit button and displays a red warning message with a link to the draft's edit history. - Makes it difficult to continue if an edit conflict is detected, forcing the user to reload the page. This is because continuing anyway would likely overwrite the previous edit. Related wikimedia-gadgets#153
* add edit conflict detection for handleComment - Only checks handleComment for now. Once we figure out a good approach in code review, will expand this to handleAccept, handleDecline, and handleReject in a future patch. - Only checks when the submit button is clicked, to avoid spamming the Wikimedia API. - When an edit conflict is detected, hides the submit button and displays a red warning message with a link to the draft's edit history. - Makes it difficult to continue if an edit conflict is detected, forcing the user to reload the page. This is because continuing anyway would likely overwrite the previous edit. Related #153 * fix promise bug. finish feature * remove debugging code
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
The text was updated successfully, but these errors were encountered: