[wp-trac] [WordPress Trac] #50244: Add bulk operation support to the Rest API
WordPress Trac
noreply at wordpress.org
Tue Jul 7 11:00:35 UTC 2020
#50244: Add bulk operation support to the Rest API
--------------------------------------+--------------------------------
Reporter: andraganescu | Owner: TimothyBlynJacobs
Type: feature request | Status: assigned
Priority: high | Milestone: 5.6
Component: REST API | Version: 4.4
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: performance
--------------------------------------+--------------------------------
Comment (by zieladam):
> If a route doesn't support pre-validation (which I think is to say that
validation is done directly in the get_items (etc) handler, why would it
matter? Route callbacks can always create errors, so avoiding that I'm
assuming is not the issue.
How this ticket was born is the following use case:
1. A batch of n, let's say 100 requests is sent over in a single request.
2. The entire dataset is validated and sanitized sufficiently to guarantee
there won't be any error caused by the input.
3. All the request handlers are being executed, only erroring out in rare
cases such as lost database connection, but never due to something being
wrong with the input.
The goal being either processing all requests or no request, but almost
never some of them. This would be even more reliable with transactions,
but they're not trivial to implement (think caches) so the first version
focuses just on the processing itself.
What you're saying, as I understand, is that there is value in having two
modes of operating: 1. Pre-validation as described above when the route
supports it 2. Simple batch processing for all routes - e.g. sending over
100 requests and expecting that e.g. 60 of them would succeed while 40
would fail. Can you think of some specific use cases where that would be
handy? Also, we'd need to distinguish between:
1. Batch requests with pre-validation vs no pre-validation (different URL?
request parameter?)
1. Endpoints supporting pre-validation vs endpoints not supporting pre-
validation (route config?)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50244#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list