fix(ios): decode local asset file URLs - #348
Open
huytdps13400 wants to merge 1 commit into
Open
Conversation
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.
Description
Fixes #335.
The iOS loader previously removed the
file://prefix with a fixed string slice, leaving percent escapes such as%20in the filesystem path passed toNSData. Release assets under paths such asApplication Supporttherefore failed to load.This change parses local asset URLs as validated
NSURLfile URLs and usesNSURL.path, which returns the unescaped filesystem path. Empty or invalid file URLs now fail with a clear error. It also initializes theNSErrorout pointer and preserves a readable fallback error if Foundation returns no description.HTTP(S) loading, bundle resource loading, and the public API are unchanged.
Test plan
Application Support/scene file.glb(%20)100%-ready.glb(%25)bun install --frozen-lockfilebun run lintbun run typescriptbun run buildgit diff --checkThe repository has no focused iOS unit-test target for this loader, so no source-inspection test was added. A syntax-only compile of the complete proxy reached CocoaPods-style React header mapping (
React/RCTViewManager.h) that is unavailable outside the generated Pods project; CI remains the full native build gate.