Skip to content
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

Closed
NovemLinguae opened this issue Mar 2, 2021 · 4 comments · Fixed by #332
Closed
Labels
C-bug Category: bug high-priority Requested by different people on different occasions

Comments

@NovemLinguae
Copy link
Member

NovemLinguae commented Mar 2, 2021

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

@enterprisey enterprisey added the C-bug Category: bug label Mar 13, 2021
@NovemLinguae
Copy link
Member Author

NovemLinguae commented Mar 24, 2021

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
Copy link

This is a duplicate of #116

@Dreamy-Jazz
Copy link

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

@NovemLinguae NovemLinguae changed the title Overwriting another reviewer's AFC decline Overwriting another reviewer's AFC accept/decline/comment Mar 28, 2022
@siddharthvp
Copy link
Member

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.

@NovemLinguae NovemLinguae added the high-priority Requested by different people on different occasions label Nov 5, 2023
@NovemLinguae NovemLinguae changed the title Overwriting another reviewer's AFC accept/decline/comment Overwriting another reviewer's AFC accept/decline/comment (edit conflict) Nov 7, 2023
@NovemLinguae NovemLinguae changed the title Overwriting another reviewer's AFC accept/decline/comment (edit conflict) Overwriting another reviewer's AFC accept/decline/comment (edit conflict avoidance) Feb 15, 2024
NovemLinguae added a commit to NovemLinguae/afc-helper that referenced this issue Apr 11, 2024
- 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
NovemLinguae added a commit that referenced this issue Apr 23, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug high-priority Requested by different people on different occasions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants