fix: Fetch uncached assets from remote server#301
Merged
Conversation
Check for valid asset paths before attempting to access them.
Ensure assets not cached locally still load in the editor. E.g., we do not download and cache images loaded within CSS files.
Merged
* Suggestions * docs: Fix inline comment typo --------- Co-authored-by: David Calhoun <github@davidcalhoun.me>
Member
Author
jkmassel
approved these changes
Jan 29, 2026
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.
What?
Prevents crashes when the editor requests assets that aren't in the local cache and adds a fallback to fetch them from the original server.
Why?
Inserting certain plugin blocks (e.g., the Writing Prompt block) causes a crash because:
url(/icon.svg)gbk-cache-httpsscheme.js/.cssfiles are cached)assetDataPath(for:)method's precondition fails when the path escapes the bundle root, causing a crashFix CMM-1176. Fix JETPACK-IOS-1JFR.
How?
Two changes:
Added
isValidAssetPath(for:)- A safe method to check if a URL resolves to a valid path within the bundle root, without triggering the precondition crashAdded remote fetching fallback - When an asset isn't in the local cache (invalid path or missing file), the provider now fetches it from the original HTTPS URL and serves it to the WebView
Testing Instructions
Accessibility Testing Instructions
N/A - No UI changes
Screenshots or screencast
N/A
Footnotes
I was unable to reproduce the crash locally, only in the TestFlight build. ↩