Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#846 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
77/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
api, mobile

Hướng nghiên cứu

Đọc src/utils/api-fetch.js và theo dõi cách nativeMediaDelete xử lý 503 từ scheme gbk-upload: và REST relay. Kiểm tra cách scheme cung cấp native_upload_unavailable; hoàn tất khi chỉ có trường hợp scheme từ chối mới kích hoạt fallback, còn 503 từ WordPress được trả về mà không gửi lại yêu cầu xóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

[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.

Ngôn ngữ chính
JavaScript
Star
29
Fork
7
Merge trung bình
2 ngày 11 giờ
Pull request đã merge (30 ngày)
75

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wordpress-mobile/GutenbergKit

Tất cả issue của wordpress-mobile/GutenbergKit

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.