[wp-trac] [WordPress Trac] #3601: Autosave causes problems if it never receives a response

WordPress Trac wp-trac at lists.automattic.com
Wed Jan 17 02:03:57 GMT 2007

#3601: Autosave causes problems if it never receives a response
 Reporter:  mdawaffe        |       Owner:  anonymous
     Type:  defect          |      Status:  new      
 Priority:  low             |   Milestone:  2.1      
Component:  Administration  |     Version:  2.1      
 Severity:  normal          |    Keywords:           
 Since autosave disables the submit buttons, you can't save your data if it
 never gets a response from the server.

 The button disabling was done to prevent collisions (multiple posts being
 created with same data), so we need a new way of preventing collisions.

  1. Re-enables buttons 1 second after disabling them.
  1. Keeps a record of the last 24 hours worth of post_IDs (and what
 temporary negative number from which they initially came).
  1. If you try to (auto)save a post with a negative post_ID, it first
 checks that record to see if that post has already been (auto)saved.  If
 so, save that post under the real id.
  1. Autosave will silently forgo writing to the DB if the post was saved
 less than autosave_interval / 2 = 120 / 2 = 60 seconds ago.

 This is accomplished by:
  1. new option: {{{autosave_draft_ids}}}
  1. a hack each in wp_write_post() and edit_post() (the functions defined
 in admin-functions.php).

 Collisions are still *possible*, but much less likely.

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

More information about the wp-trac mailing list