[wp-trac] [WordPress Trac] #49532: Clicking "preview" multiple times on a post causes an identical autosave revision to be created and destroyed repeatedly

WordPress Trac noreply at wordpress.org
Wed Dec 29 20:59:26 UTC 2021


#49532: Clicking "preview" multiple times on a post causes an identical autosave
revision to be created and destroyed repeatedly
--------------------------+------------------------------------
 Reporter:  inwerpsel     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Revisions     |     Version:  5.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  rest-api, performance
--------------------------+------------------------------------

Comment (by adamsilverstein):

 > Proposed solution:
 > Either no record should be created in the first place if there is no
 difference, or the existing record shouldn't be deleted, even if it
 doesn't have any changes.

 @inwerpsel thank you for opening this ticket and all the details around
 your efforts to prevent the behavior you described. Indeed: creating an
 autosave, then deleting it, then recreating it in an endless cycle is not
 the ideal (or intended) behavior.

 I came across this ticket when working on previewing featured images in
 block themes because the underlying preview code that adjust post terms
 and the "thumbnail" (featured) image was failing when the autosave is
 missing. As you point out this happens every other autosave and autosaves
 are fired every time you preview a post.

 I believe your suggestion that no autosave should be created when the
 autosave content matches the post content would be the cleanest way to
 resolve the issue, I'll look into that.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49532#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list