You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider removing the native media delete relay #860
#594 sends the media upload orphan cleanup (DELETE /wp/v2/media/<id>) through native code: the Android loopback upload server and the iOS upload scheme. It did so because a cross-origin editor couldn't send that request: api-fetch sends DELETE as a POST with X-HTTP-Method-Override, and the CORS preflight rejects that header.
#841 sends cross-origin writes with their real method, which the preflight allows. With that in place the relay may no longer be needed. Both native routes only forward the request; neither does any bookkeeping of its own.
What is your proposed solution?
Consider removing the relay and letting the editor send the deletion directly:
nativeMediaDelete in src/utils/api-fetch.js
The DELETE /media/<id> route in MediaUploadServer.kt
The …/media/<id>/delete route in MediaUploadSchemeHandler.swift. iOS deletions would go through the REST relay, as they already do after stopMediaHandling().
Their tests
To verify, use #594's media failure simulator to exhaust the post-process retries. Then check that the orphaned attachment is deleted on an Android site whose REST API is on another origin, on a same-origin Android site, and on iOS.
Activity