[wp-trac] [WordPress Trac] #47987: REST API: Add handling of PHP fatal errors while resizing images after upload
WordPress Trac
noreply at wordpress.org
Fri Sep 27 08:36:34 UTC 2019
#47987: REST API: Add handling of PHP fatal errors while resizing images after
upload
-----------------------------+--------------------------------
Reporter: azaozz | Owner: TimothyBlynJacobs
Type: task (blessed) | Status: accepted
Priority: highest omg bbq | Milestone: 5.3
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
-----------------------------+--------------------------------
Comment (by talldanwp):
I like the stripe idempotency idea @TimothyBlynJacobs mentioned. It would
definitely require some agreement that it's the right approach across the
API, but it seems a close fit to the existing retries model being
proposed.
Some more detail here: https://stripe.com/au/blog/idempotency
The difference would be that those keys shouldn't really be shared across
endpoints, so a key wouldn't necessarily be considered a reference to the
media, but a reference to the specific HTTP request that needs to be
retried/resumed.
> It's up to the API maintainers but having a separate "action" for post-
processing seems to make sense?
I'm a little unfamiliar with the media endpoints, but it'd seem to me that
if the `create_item()` endpoint tries to handle post-processing on the
first attempt, but fails, then it should try again on the second attempt
in an idempotent model.
It could probably also work as separate endpoints, though.
A separate question @azaozz, how would the client handle incomplete
requests if it's interrupted (i.e. the user reloads the page after an
upload)?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47987#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list