Follow-ups from the #625 review: upload credential refresh, native file input, cleanups
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- ios, javascript
- Lĩnh vực
- mobile
Hướng nghiên cứu
Start by reading AGENTS.md and tracing updateConfiguration(_:), prepareNativeHandlers(), InternalMediaClient, and the upload flow in api-fetch.js. Check how credentials and mixed selections reach uploads, then review the listed cleanup points in MediaUpload, RestRelaySchemeHandler, and EditorViewController. Done means the credential behavior and native file selection are correct and the documented cleanup and call-order issues are resolved.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-ups from the review of #625. None of these block it.
1. A new credential reaches REST but not uploads
What happens: a host calls updateConfiguration(_:) with a new authHeader before the editor loads. REST requests use the new credential. Media uploads and deletes still use the one the editor was created with.
Who is affected: a host that refreshes an expired token this way. REST works, but every upload fails with a 401.
How this was checked: in the iOS 27.0 Simulator against wp-env, we created the editor with a valid credential, then updated it to a wrong one. REST got rest_forbidden. The upload got 201, so it went out with the old credential.
This is pre-existing: the old upload server also used the client built at init. But prepareNativeHandlers() now says it rebuilds the upload service "with the credential that the page is given", which isn't true for uploads.
Suggested fix: have InternalMediaClient set Authorization from configuration.authHeader on each request, or correct the doc comment.
2. A system file picker can appear for a mixed selection
What happens: if the host passes the inserter a selection where the first item has an id (a library item) and a later one is an imported file, the page clicks the native file input but never waits for the files. The native offer ends, and WebKit can show its own file picker.
Who is affected: only a host that mixes library items and imported files in one selection. The page already assumes selections are never mixed. Not reproduced.
Suggested fix: only call requestNativeFiles() on the path that uses the files, or make the "never mixed" rule hold.
3. Cleanups
MediaUpload.fileURLis deleted as soon asuploadreturns, but the docs don't say so. They mention an offline queue, so a host could store the URL and find the file gone. Document it.- A staged upload stays on disk if the page dies mid-upload and no cancel arrives. It is cleaned up at the next upload or when the editor is released, so this is bounded.
RestRelaySchemeHandler.cancelAll()is only called from tests, but its comment says "as a teardown would". Wire it into teardown, or delete it.EditorViewControllerbuilds the relay and upload service ininit, then rebuilds them on every load. Build them in one place.- In
api-fetch.js,loopbackUploadsits beforeschemeUpload, which breaks the call-order convention inAGENTS.md.
- Ngôn ngữ chính
- JavaScript
- Star
- 29
- Fork
- 6
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 76
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wordpress-mobile/GutenbergKit
-
[Type] Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
wordpress-mobile/GutenbergKit#940 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wordpress-mobile/GutenbergKit#884 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug Android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
wordpress-mobile/GutenbergKit#847 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug iOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
wordpress-mobile/GutenbergKit#846 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug [Type] Code Quality iOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
wordpress-mobile/GutenbergKit#668 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wordpress-mobile/GutenbergKit
Issue tương tự
-
Remove: Tele Azul LogoĐang mởcheck:passed logos:remove
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
intuitem/ciso-assistant-community#5380 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
TarteelAI/quranic-universal-library#1111 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ryoku type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feedback simulation workshop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
githubnext/gh-aw-workshop#6094 ·
Maintainer thường phản hồi trong vòng 1 ngày