[wp-trac] [WordPress Trac] #43316: REST API: Support autosaves

WordPress Trac noreply at wordpress.org
Wed Jun 20 16:23:14 UTC 2018


#43316: REST API: Support autosaves
-------------------------------------------------+-------------------------
 Reporter:  kraftbj                              |       Owner:  rmccue
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.0
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:  rest-api
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by aduth):

 Replying to [comment:62 azaozz]:
 > Auto-save:
 >
 > ''[...]''
 >  - When creating a revision following the above logic, if an autosaved
 revision already exists, it is updated instead of creating another
 autosaved revision. **Additionally if the post content is identical to the
 new content that is being auto-saved, the previous autosave revision is
 deleted to prevent having a redundant revision (i.e. if the update of the
 previous autosaved revision will make it identical to the current post,
 there is no need of it).**

 With regards to this and relating to
 [https://core.trac.wordpress.org/attachment/ticket/43316/43316.14.diff the
 most recent patch version], I'm confused by the proposed flow where an
 error is returned from the endpoint.

 1. Do we really need to return an error? Can't we just treat it as though
 it were successful even if in-fact the server is ensuring there are no
 redundant revisions? Otherwise this can result in challenges from the
 client in ensuring to not send fields which are already the saved value
 for the autosave.
 2. Because we delete the revision and then return immediately with an
 error, isn't it true that we're not simply not storing redundant revision,
 we're in fact destroying a revision without having anything new to serve
 in its place?

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


More information about the wp-trac mailing list