Clicking preview multiple times causes the autosave revision to be created and deleted repeatedly. #20505
Labels
[Feature] Saving
Related to saving functionality
[Status] Needs More Info
Follow-up required in order to be actionable.
[Status] Stale
Gives the original author opportunity to update before closing. Can be reopened as needed.
Describe the bug
Click the preview button multiple times in a row, without making any changes to the post in between. This will result with the autosave revision being created and destroyed repeatedly (check the response of the api request that does the autosave, it alternates between 200 and 400).
To reproduce
Steps to reproduce the behavior:
/wp-json/wp/v2/post_type/{id}/autosaves
that gets a 200 response code.Expected behavior
Clicking the preview button multiple times without any changes to the post should not create a record more than once.
Perhaps this is something that should be fully tackled on the backend side, however maybe a solution/mitigation in the gutenberg editor is possible here? For example the editor could not send the request in the first place when pressing the preview button consecutively.
Additional context
The text was updated successfully, but these errors were encountered: