Page MenuHomePhabricator

Undo does not detect "the revision was already undone", instead displaying "can be undone" with an empty diff
Closed, ResolvedPublic


After looking at the only edit made by an IP on Portuguese Wikipedia
and going to the diff of his edit[1] and clicking on "undo", which points to page [2], MediaWiki displayed the text of [[MediaWiki:undo-success]] but the diff was empty, I mean, there was no changes made.

Could you check why it didn't revert to the original version of the article? (or, alternatively, if it is not able to revert, why didn't show [[MediaWiki:undo-failure]] instead?)

PS: For now, I didn't remove the content, so that you can check what is wrong.


Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:32 PM
bzimport set Reference to bz29762.
He7d3r created this task.Jul 7 2011, 8:06 PM
Anomie added a comment.Dec 8 2013, 2:43 PM

Undo works much like edit conflict resolution: it acts as if you had opened an edit window at the revision of the IP's edit and pasted in the previous revision's content, and then tries to merge the resulting change with all of the changes that were made to the page after the IP's edit. If it succeeds then the undo is deemed successful, while if there would be an edit conflict then it says the undo was unsuccessful.

What appears to have happened there is that a following edit[1] moved the IP's text from the end of the page to somewhere above the interwiki links. So when it takes your undo revision of "remove the text from the end of the article" combined with that bot's revision of "remove the text from the end of the article, insert the text somewhere else in the article, and insert an interwiki link", the merge succeeds because the "remove the text from the end of the article" bits in both of those edits are recognized as doing the same thing.

This situation should probably be detected with a message along the lines of "The edit appears to have already been undone" instead of displaying an empty diff.

I note that the result you state you expected, that the article was restored to the version before the IP's edit, is probably *not* what you would actually have wanted. Judging by the timestamp on the original bug report, that would have reverted many additional edits.[2]


Change 100211 had a related patch set uploaded by Anomie:
Detect already-undone edits for undo

Change 100211 merged by jenkins-bot:
Detect already-undone edits for undo

Anomie added a comment.Feb 4 2014, 8:21 PM

This should be deployed to WMF wikis with 1.23wmf13, see for the schedule.