Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a9cb6d9
feat: add gbkOptimizeMediaUploads feature flag
dcalhoun Jul 22, 2026
6051a74
build: use GutenbergKit pr-build/357 snapshot
dcalhoun Jul 22, 2026
fb3f270
feat: process GutenbergKit media uploads with app Media settings
dcalhoun Jul 22, 2026
72c81d7
test: cover GBKMediaUploadProcessor media processing
dcalhoun Jul 22, 2026
327fce9
feat: surface media upload optimization in Experimental Features
dcalhoun Jul 22, 2026
c6eaa2e
refactor: set media upload delegate unconditionally
dcalhoun Jul 23, 2026
bd08c35
Revert "feat: surface media upload optimization in Experimental Featu…
dcalhoun Jul 23, 2026
0bae62a
Revert "feat: add gbkOptimizeMediaUploads feature flag"
dcalhoun Jul 23, 2026
435046a
build: track GutenbergKit trunk for native media uploads
dcalhoun Aug 16, 2026
ebb91a2
fix: pass SVG uploads through unprocessed
dcalhoun Aug 17, 2026
dd8c5bb
fix: stop leaking a temporary directory per media upload
dcalhoun Aug 17, 2026
c140b41
docs: clarify when the image export is skipped
dcalhoun Aug 17, 2026
f75b328
refactor: set exportImageType only for image exports
dcalhoun Aug 17, 2026
32f978a
test: make the shared export directory test meaningful
dcalhoun Aug 17, 2026
0c82375
build: Update to GutenbergKit v0.20.0-alpha.0
dcalhoun Aug 17, 2026
54c444c
build: sync root Package.resolved to GutenbergKit v0.20.0-alpha.0
dcalhoun Aug 18, 2026
9d71b69
fix: harden media upload processing against type and cleanup gaps
dcalhoun Aug 18, 2026
8b2acf3
feat: skip the temp-file copy for uploads the processor won't touch
dcalhoun Aug 18, 2026
64c2e16
fix: stop re-checking uploads against the site's cached file types
dcalhoun Aug 25, 2026
31a6cf1
Merge remote-tracking branch 'origin/trunk' into feat/process-gutenbe…
dcalhoun Aug 25, 2026
4b7f01e
fix: keep the editor alive past its async load in the GBK editor tests
dcalhoun Aug 25, 2026
0219c4e
fix: resolve the upload type the same way in both delegate methods
dcalhoun Aug 25, 2026
f976b7b
fix: upload processed media under the name the editor sent
dcalhoun Aug 25, 2026
7293772
fix: write every export to one reused temporary directory
dcalhoun Aug 25, 2026
6eb2f32
perf: decline SVG uploads before copying them to disk
dcalhoun Aug 25, 2026
1635ae3
refactor: drop the unreachable .gif entry from webSafeImageTypes
dcalhoun Aug 25, 2026
13822ba
test: retain GBK editors past the async load they start
dcalhoun Aug 25, 2026
b039696
fix: classify uploads whose extension no UTI declares
dcalhoun Aug 26, 2026
ca6cda9
fix: pass through video AVFoundation cannot read
dcalhoun Aug 26, 2026
6526986
docs: correct the upload validation claim in the GBK processor
dcalhoun Aug 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Modules/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Modules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let package = Package(
revision: "b34794c9a3f32312e1593d4a3d120572afa0d010"
),
.package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"),
.package(url: "https://github.com/wordpress-mobile/GutenbergKit", from: "0.19.0"),
.package(url: "https://github.com/wordpress-mobile/GutenbergKit", from: "0.20.0-alpha.0"),
.package(
url: "https://github.com/automattic/wordpress-rs",
exact: "0.6.0"
Expand Down
6 changes: 3 additions & 3 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,36 @@ import UIKit
@testable import WordPress
@testable import WordPressData

/// Keeps every editor these tests build alive for the lifetime of the process.
///
/// `viewDidLoad` starts the editor's load on a `Task` that reaches
/// `startUploadServer()` after the test method returns, where GutenbergKit
/// asserts an assigned `mediaUploadDelegate` is still alive. Tripping that
/// precondition crashes the test host, killing every concurrently running suite
/// — so the damage is not contained to this file.
///
/// Only a test can reach that state. `PostGBKEditorViewController` holds the
/// editor and its `GBKMediaUploadProcessor` as strong `let`s on one object, so
/// in the app they always die together and the load's `[weak self]` is already
/// nil. Here a window is the controller's only owner, so releasing it mid-load
/// leaves the editor reachable with a dead delegate.
///
/// Retention must outlive the *suite instance*: Swift Testing builds a fresh
/// one per test, so an instance property dies at the very deadline being
/// missed. The race is timing-dependent, so a green run does not prove the
/// hazard is gone.
@MainActor
private enum RetainedEditors {
static var windows: [UIWindow] = []
}

@MainActor
@Suite(.serialized)
struct PostGBKEditorViewControllerTests {

@Test("presents the site media library for GutenbergKit requests")
func presentsSiteMediaLibrary() throws {
let context = ContextManager.forTesting().mainContext
let blog = BlogBuilder(context).build()
/// Builds an editor, retaining it for the process's lifetime so the load it
/// starts cannot outlive its delegate. See ``RetainedEditors``.
private func makeEditor(blog: Blog) -> PostGBKEditorViewController {
let viewController = PostGBKEditorViewController(
postId: nil,
postType: .post,
Expand All @@ -26,6 +48,15 @@ struct PostGBKEditorViewControllerTests {
window.rootViewController = viewController
window.makeKeyAndVisible()
viewController.loadViewIfNeeded()
RetainedEditors.windows.append(window)
return viewController
}

@Test("presents the site media library for GutenbergKit requests")
func presentsSiteMediaLibrary() throws {
let context = ContextManager.forTesting().mainContext
let blog = BlogBuilder(context).build()
let viewController = makeEditor(blog: blog)

let data = Data(
#"{"allowedTypes":["image"],"multiple":true,"value":[],"contextId":"test"}"#.utf8
Expand Down Expand Up @@ -108,18 +139,7 @@ struct PostGBKEditorViewControllerTests {
for blog: Blog,
requesting mediaIds: [Int]
) throws -> SiteMediaPickerViewController {
let viewController = PostGBKEditorViewController(
postId: nil,
postType: .post,
title: "",
content: "",
status: "draft",
blog: blog
)
let window = UIWindow()
window.rootViewController = viewController
window.makeKeyAndVisible()
viewController.loadViewIfNeeded()
let viewController = makeEditor(blog: blog)

let value = mediaIds.map(String.init).joined(separator: ",")
let data = Data(
Expand Down
Loading