feat!: remove MediaUploadDelegate.uploadFile - #629
Draft
jkmassel wants to merge 1 commit into
Draft
Conversation
`MediaUploader` replaces it. Returning a raw response split one upload's HTTP across two owners — the host performed the `POST`, the editor drove the `post-process` retries and orphan cleanup behind it — and the hook received no form fields, so an attachment it uploaded landed unattached to its post. Neither is fixable while the hook returns a raw response, which is what the replacement changes. What is left is a clean division: a delegate transforms bytes and GutenbergKit owns delivery and its retries; a `MediaUploader` owns delivery and its retries entirely. There is no longer an in-between where the host performs the upload but the editor retries it. `handlesFile` no longer gates the temp copy for two callers, only for `processFile` — and only when no uploader is set, since an uploader takes over delivery for every file. `MediaUploadResponse` drops to internal on both platforms: `uploadFile` was the only public API that named it. BREAKING CHANGE: hosts implementing `uploadFile` must conform to `MediaUploader` instead. Hosts that only implement `processFile` / `handlesFile` are unaffected.
This was referenced Sep 5, 2026
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/629")Built from f5cbf24 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #628. Sixth of ten PRs splitting #621. Almost entirely deletions.
What?
Removes
uploadFilefromMediaUploadDelegateon both platforms.MediaUploader(#628) replaces it.Why?
Returning a raw response split one upload's HTTP across two owners — the host performed the
POST, the editor drove thepost-processretries and orphan cleanup behind it — and the hook received no form fields, so an attachment it uploaded landed unattached to its post. Neither is fixable while the hook returns a raw response.What is left is a clean division: a delegate transforms bytes and GutenbergKit owns delivery and its retries; a
MediaUploaderowns delivery and its retries entirely. There is no longer an in-between where the host performs the upload but the editor retries it.How?
handlesFileno longer gates the temp copy for two callers, only forprocessFile— and only when no uploader is set.MediaUploadResponsedrops to internal on both platforms:uploadFilewas the only public API that named it.Testing Instructions
Tests for the removed path are rewritten rather than deleted — the delegate now processes and the internal client delivers, which is what the remaining path does.
swift test— host suite green:Gutenberg:testDebugUnitTestgreenxcodebuild; Android demo compilesBreaking change
Hosts implementing
uploadFilemust conform toMediaUploaderinstead. Hosts that only implementprocessFile/handlesFileare unaffected. Migration needed in WordPress-iOS, WordPress-Android and Jetpack.