[wp-trac] [WordPress Trac] #16928: Autosave collision detection does not alert user or prevent further overwriting content

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 22 07:05:38 UTC 2011


#16928: Autosave collision detection does not alert user or prevent further
overwriting content
--------------------------+-------------------------------------
 Reporter:  benbalter     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Autosave      |    Version:  3.1
 Severity:  normal        |   Keywords:  needs-patch 2nd-opinion
--------------------------+-------------------------------------
 When editing a post, upon detecting that another user has modified that
 same post, the autosave function neither alerts the user as to the
 conflict nor does it prevent the user from overwriting the other user's
 changes.

 To reproduce: Login as a user ("User 1") and edit an existing post. Open a
 2nd incognito/private browsing window and login as a different user ("User
 2"). Navigate to the same post and hit update as User 2. Although admin-
 ajax pushes a notice through its response, User 1 has no way of knowing
 that User 2 now has the file lock.

 Believe the problem lies in line 89 of autosave.dev.js.
 {{{
 message = res.responses[0].data;
 }}}
 The error data is being properly passed form admin-ajax, but is not being
 properly handled on the client side.

 The issue is that the error message doesn't end up in the expected
 location in the response. The attached patch looks in the second location
 for the message as appropriate. However, a proper fix might instead be in
 wpAjax, as the intent might be that responses[0].data should be reflecting
 the error message.

 Beyond notice in the ajax message window, as an additional enhancement
 (for another ticket), at the very least errors should be big, red, and
 possibly with the <blink> tag, perhaps a modal dialog or other means of
 temporarily disabling update (and re-enabling autosave) may be prudent as
 well. A div class="error" should probably be desired behavior, similar to
 other warnings sometimes shown here.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16928>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list