Last modified: 2014-02-04 20:21:37 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31762, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29762 - Undo does not detect "the revision was already undone", instead displaying "can be undone" with an empty diff
Undo does not detect "the revision was already undone", instead displaying "c...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-07 20:06 UTC by Helder
Modified: 2014-02-04 20:21 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2011-07-07 20:06:25 UTC
After looking at the only edit made by an IP on Portuguese Wikipedia
([[pt:Special:Contributions/200.207.233.191]])
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.

[1] https://secure.wikimedia.org/wikipedia/pt/w/index.php?title=Lens_%28Fran%E7a%29&diff=prev&oldid=21742940&uselang=en
[2] https://secure.wikimedia.org/wikipedia/pt/w/index.php?title=Lens_%28Fran%C3%A7a%29&action=edit&undoafter=20854041&undo=21742940&uselang=en
Comment 1 Brad Jorsch 2013-12-08 14:43:24 UTC
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]


 [1]: https://pt.wikipedia.org/w/index.php?title=Lens_%28Pas-de-Calais%29&diff=22824326&oldid=21742940
 [2]: https://pt.wikipedia.org/w/index.php?title=Lens_%28Pas-de-Calais%29&diff=26449837&oldid=20854041
Comment 2 Gerrit Notification Bot 2013-12-08 15:19:19 UTC
Change 100211 had a related patch set uploaded by Anomie:
Detect already-undone edits for undo

https://gerrit.wikimedia.org/r/100211
Comment 3 Gerrit Notification Bot 2014-02-04 19:55:57 UTC
Change 100211 merged by jenkins-bot:
Detect already-undone edits for undo

https://gerrit.wikimedia.org/r/100211
Comment 4 Brad Jorsch 2014-02-04 20:21:37 UTC
This should be deployed to WMF wikis with 1.23wmf13, see https://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links