Conversation
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/637")Built from e6493f1 |
jkmassel
force-pushed
the
docs/media-field-decode-invariant
branch
from
September 9, 2026 00:58
7447607 to
7d96796
Compare
This was referenced Sep 14, 2026
jkmassel
force-pushed
the
docs/media-field-decode-invariant
branch
from
September 15, 2026 22:39
7d96796 to
48e341f
Compare
jkmassel
force-pushed
the
test/media-mock-cleanup
branch
from
September 15, 2026 22:39
8bbf776 to
96df139
Compare
`TranscodingProcessor` duplicated `ResizingProcessor` — same `.processed(_, mimeType: "video/mp4", filename: "clip.mp4")` result, one call site — and was the weaker of the two. It wrote to a fixed `$TMPDIR/clip.mp4` instead of a per-call UUID path inside the managed upload directory, and swallowed the write with `try?`, so a failed write still returned `.processed(<nonexistent URL>, …)` and the test passed green against a file that never existed. `ResizingProcessor` uses `try` and a unique path. Also drops `@unchecked Sendable` from `ThrowingUploader` and `DecliningProcessor`, which are stateless. The escape hatch is only needed by the mocks holding `NSLock`-guarded state; carrying it on stateless ones normalizes it as boilerplate, which is how a real race gets hidden later. `ContentTypeDeleteClient` keeps it — it subclasses an `@unchecked Sendable` class and must restate the conformance.
jkmassel
force-pushed
the
docs/media-field-decode-invariant
branch
from
September 16, 2026 19:41
48e341f to
73aa209
Compare
jkmassel
force-pushed
the
test/media-mock-cleanup
branch
from
September 16, 2026 19:41
96df139 to
e6493f1
Compare
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 #633. Follow-up from an adversarial review of #625.
What?
Deletes
TranscodingProcessorand points its one call site at the existingResizingProcessor. Drops@unchecked Sendablefrom two stateless mocks.Why?
TranscodingProcessorwas a duplicate ofResizingProcessor— same.processed(_, mimeType: "video/mp4", filename: "clip.mp4")result, one call site — and the weaker of the two on both counts that matter:$TMPDIR/clip.mp4rather than a per-call UUID path inside the managed upload directory.processAndUpload's cleanupdeferthen deletes that path, so the mock unlinks a process-wide filename it does not own. Verified by planting a sentinel:before: exists=true→after: exists=false.try?and still returned.processed(<URL>, …). Forcing the write to fail leaves the file absent and all four assertions still pass — the test cannot detect a regression where processing silently produces nothing.ResizingProcessorusestry.@unchecked SendableonThrowingUploaderandDecliningProcessorbought nothing — both are statelessfinal classes that satisfy the conformance on their own. The annotation belongs on the mocks holdingNSLock-guarded state; carrying it on stateless ones normalizes it as boilerplate, which is how an unsynchronized property gets added later without a diagnostic.How?
TranscodingProcessordeleted;processesForHostReleasedDelegateusesResizingProcessor.@unchecked Sendableremoved fromThrowingUploaderandDecliningProcessor.ContentTypeDeleteClientkeeps it — it subclasses an@unchecked Sendableclass and must restate the conformance.Mutation sensitivity is unchanged: against a weakly-held processor the swapped test still fails in all four places with the real symptom (
passthroughUploadCalled → true).Testing Instructions
swift test— 981 tests, host suite greenswift build --build-tests— zero warnings in the library and test targetsRelated
Two other findings from the same review are already fixed upstream in this stack: the off-main delegate release (
HTTPServer.stop()now clearsnewConnectionHandler) and the#WeakMutabilitywarning, both in #625.EditorViewControllerMediaLifetimeTests— vacuous for the same class of reason, since it never loads the editor — has been deleted on #625, where the file lived. That also removedLifetimeProbeDelegate, so the mock cleanup in this PR is the remainder.