Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

iOS: a WordPress 503 on a media delete sends the delete twice

Aperta Adatta ai principianti
#846 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
77/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
api, mobile

Direzione di ricerca

Leggi src/utils/api-fetch.js e segui come nativeMediaDelete gestisce un 503 proveniente dallo schema gbk-upload: e dal relay REST. Controlla come lo schema espone native_upload_unavailable; il lavoro è completato quando solo il rifiuto di quello schema attiva il fallback, mentre un 503 di WordPress viene restituito senza inviare di nuovo la richiesta di eliminazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

[Type] Bug iOS

On iOS, when WordPress answers a media delete with 503, the editor sends the delete a second time.

Follow-up from #594.

What happens

nativeMediaDelete in src/utils/api-fetch.js sends a media delete through the gbk-upload: scheme. When the scheme answers 503, the delete goes down the middleware chain and out through the REST relay instead. That fallback exists for one case: after stopMediaHandling(), the scheme refuses every request with 503.

The scheme also relays WordPress's own response unchanged, status included. So a 503 from WordPress — a site in maintenance mode, or an overloaded host — looks the same as the scheme's refusal, and the delete is sent again.

Who is affected

iOS only. The main sender is core's orphan cleanup, after an upload's post-process retries all fail. A site failing that way is the kind most likely to answer 503.

The impact is small: deleting an attachment twice deletes it once. The cost is one extra request to a struggling site, and the caller sees the second request's error instead of the first.

Suggested fix

Have the page check the scheme's own error code (native_upload_unavailable) rather than the status alone. Only that refusal should fall back to the REST relay.

Lingua principale
JavaScript
Stelle
29
Fork
7
Merge medio
2g 3h
PR unite (30g)
70

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wordpress-mobile/GutenbergKit

Tutte le issue di wordpress-mobile/GutenbergKit

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.