fix(assets): prefer bundled asset over CDN cache when resolving paths - #2331
Closed
TheNoumanDev wants to merge 1 commit into
Closed
fix(assets): prefer bundled asset over CDN cache when resolving paths#2331TheNoumanDev wants to merge 1 commit into
TheNoumanDev wants to merge 1 commit into
Conversation
TheNoumanDev
force-pushed
the
fix/cdn-asset-path
branch
from
August 5, 2026 12:03
28c1385 to
a83dbdf
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.
Problem
In CDN-provider apps, an asset that is bundled in the app could still be resolved to an on-device CDN-cache file path (e.g.
/data/user/0/<app>/files/asset_cache/assets/card_ERE.jpg) instead of its bundle key. That file path is then handed toImage.asset(), which expects a bundle key — so the image renders blank, even though a perfectly good bundled copy ships in the app.Cause
Utils.getLocalAssetFullPath()(which picks the path to load) checked the CDN cache first, and only fell back to the bundled key:But
Utils.isAssetAvailableLocally()(the "do we have it offline?" check) used the opposite order — bundled first, then cache. So the two disagreed: availability said "yes, it's bundled," while resolution returned the cache file path → blank.Fix
Make the resolver agree with the availability check — bundled first, then CDN cache:
A bundled asset now resolves to its bundle key, so
Image.assetreads it directly — no download, and no dependency on the cache path being readable.What this changes for a project
Out of scope
This PR changes lookup priority only. It does not change how a non-bundled CDN-cached asset renders — that still resolves to a file path and needs a separate
*.fileloading fix to paint. Deliberately left out of this change.