Repository navigation
Conversation
A request can now list `alternatives` to load when its source fails, and a `lowDataURL` to load when Low Data Mode keeps it off the network. The fallbacks are per image task, above the task graph, and each source is a load of its own. Tasks for one image share the load of its source whatever they fall back to, so nothing changes in the keys, and a fallback is cached under its own keys: a passing failure can't pin a mirror's image in the place of the real one, and every load tries the source again. A request kept off constrained networks no longer shares a fetch with one that isn't, which also fixes that for a `URLRequest` that sets the flag.
kean
force-pushed
the
feat/fallback-sources
branch
from
November 3, 2026 00:51
881bc72 to
11281e9
Compare
This branch has not been deployed
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.
ImageRequest/alternativesloads another source when the request's own fails, andImageRequest/lowDataURLloads a smaller image when Low Data Mode keeps it off the network. Each fallback is a load of its own, under its own cache keys, so a one-off 500 can't pin it in place of the real image, and every load tries the source again.Proof
MockDataLoader: request count and order, a later load trying the source again, the fallback's bytes under the fallback's key, coalescing, cancellation,ImagePrefetcher,LazyImage, metrics. With the fallback path disabled, 33 fail.noDeduplicationGivenRequestKeptOffConstrainedNetworksfails on main (1 download for 2 tasks) and passes here. It covers the newallowsConstrainedNetworkAccesskey field.NukeandNukeUIon macOS (1,822 and 637), iOS 27 and tvOS (1,866 and 647). The only stable failures,policyIsReevaluatedWhenMoreDataArrivesandpreviewPolicyIsReevaluatedOnlyWhenTheDataDoubles, fail the same way on main on this Mac. Timing tests that failed in full runs at load average 150+ passed when rerun alone.Containerstays 112 bytes. Instructions retired, 7 interleaved rounds: create +0.3%, copy +0.2–0.3%,url+34,urlRequest+86. Memory hit and full load are inside their noise (5–10%).URLProtocolstub through a realURLSession.