Repository navigation
Conversation
kean
force-pushed
the
fix/will-cache-nuke-13-compat
branch
from
October 31, 2026 20:27
bfe2cef to
20ec614
Compare
A Nuke 13 willCache(data:image:for:pipeline:completion:) compiled against Nuke 14 with no diagnostic and was never called, so a delegate that kept private images off the disk silently stopped doing so. The method is a requirement again, and the default implementation of the async one calls it. The pipeline now waits for a closure that Nuke 13 didn't wait for, so one that is never called resolves to nil when it's released, and only the first call counts.
kean
force-pushed
the
fix/will-cache-nuke-13-compat
branch
from
November 3, 2026 00:51
20ec614 to
425799d
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.
A Nuke 13
willCache(data:image:for:pipeline:completion:)compiles against Nuke 14 with no diagnostic and was never called, so a delegate that kept private images off the disk silently started writing them. The method is a requirement again and the default asyncwillCacheforwards to it. It's soft-deprecated in the docs only:@available(*, deprecated)warns inside the default implementation and says nothing to the delegate. The guide andnuke-migratenow say it keeps working, and keep the warning for the other old delegate methods.The pipeline waits for a closure that Nuke 13 didn't wait for, so a closure that is never called resolves to
nilwhen it's released, and only the first call counts. With a plain continuation, as first proposed, the first case hung the load and the second crashed it.Proof
ImagePipelineDelegateCachingTests, macOS, Xcode 27.1 RC. The suite went from 12 to 21 tests:maincompletion(nil)callCount → 0,["…/example.jpeg": 22789 bytes]stored.automatic)callCount → 0, 7 bytes storedcompletioncompletiontwicewillCacheat allA Swift 5 mode client in Release, with Nuke built at deployment target macOS 15, where the actor isolation checks fire. Same delegates, each run with a real pipeline:
completionleaked its continuationtried to resume its continuation more than onceCost of
pipeline.willCacheper store, Release, 10 interleaved A/B rounds, medians:mainwillCacheisDefaultDelegatestill returns before the delegate is touched, so the no-delegate row runs no new code. The last row is noise: the ranges overlap (7.7–13.6 and 8.0–13.5 µs) at a load average of 40. The real cost is +66 ns per disk write, and only for a delegate that doesn't implementwillCache.No new compiler warnings: a clean build of
Nukeand its tests gives the same warnings asmain, including the conformances above. The fullNukescheme passes on macOS (1,739 tests, 1 skipped), and so domake snippets,make lint,generate-llms.py --check, and a docbuild.Not verified: Xcode 26 locally, because the 26.6 install here is damaged, so CI is the first compile on it. iOS and tvOS weren't run: the change has no platform code.