Opened 17 years ago
Closed 17 years ago
#3601 closed defect (bug) (fixed)
Autosave causes problems if it never receives a response
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.1 | Priority: | low |
Severity: | normal | Version: | 2.1 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
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.
Attached:
- Re-enables buttons 1 second after disabling them.
- Keeps a record of the last 24 hours worth of post_IDs (and what temporary negative number from which they initially came).
- 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.
- 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:
- new option:
autosave_draft_ids
- 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.
Attachments (2)
Change History (5)
#2
@
17 years ago
rboren: Just wondering if one might stomp the others changes to the array. rboren: If they both get the array before the other writes. mdawaffe: rboren: oh I see - yes that's possible mdawaffe: I guess it could go in usermeta instead rboren: Yeah, that's what I'm thinking. Each user has his own autosave list. mdawaffe: metakey = table_prefix . 'autosave_draft_ids'
Note: See
TracTickets for help on using
tickets.
If two people are editing concurrently on the same blog, will there be contention when updating the autosave record? That's probably too corner-case to worry much about though.