Page MenuHomePhabricator

Edit conflict sometimes created when using "back" button in browser
Closed, DeclinedPublic

Description

Author: amirvis

Description:
Sometimes it is possible to edit a page, save the edit, return to the editing window by clicking the "back" button in one's browser, editing further, and saving again. However, this often results in an edit conflict, even if no one else has edited the page in the mean time. If an example helps, here is a diff of the first edit in such a pair: http://en.wikipedia.org/w/index.php?title=Specific_impulse&diff=323317564&oldid=322564554.

It would be tremendously convenient to always be able to use the back button, to easily return to the same sentence one was just editing.


Version: unspecified
Severity: enhancement

Details

Reference
bz21376

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:47 PM
bzimport set Reference to bz21376.
bzimport added a subscriber: Unknown Object (MLST).

svippy wrote:

Each edit session uses a token to ensure that it is the same edit, and to avoid spam (and yes, to check for edit conflicts). As such, continued editing should always be using the edit link to produce a new token.

In other words, to allow this feature, you would require a new token to be produce when you use the back link, which ''will'' require a refresh of the page, thus rendering the purpose of this feature close to pointless.

If you're editing a full page, edit conflicts with yourself won't happen; they will happen for section edits though.

The issue is because the edit form includes 2 hidden input fields that have the revision timestamp of the revision you're editing and the time you started editing. These will both be wrong when using the back button. When you try to save the page, the server thinks you're editing an older version than you actually are. From a few minutes of looking, I can't find any way to force the browser to reload the page when using the back button that doesn't use some JS hack; but as Svip noted, if you have to reload the page, it somewhat defeats the purpose.