Skip to content

fix(ios): decode local asset file URLs - #348

Open
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/335-decode-ios-file-urls
Open

fix(ios): decode local asset file URLs#348
huytdps13400 wants to merge 1 commit into
margelo:mainfrom
huytdps13400:fix/335-decode-ios-file-urls

Conversation

@huytdps13400

Copy link
Copy Markdown

Description

Fixes #335.

The iOS loader previously removed the file:// prefix with a fixed string slice, leaving percent escapes such as %20 in the filesystem path passed to NSData. Release assets under paths such as Application Support therefore failed to load.

This change parses local asset URLs as validated NSURL file URLs and uses NSURL.path, which returns the unescaped filesystem path. Empty or invalid file URLs now fail with a clear error. It also initializes the NSError out 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

  • task-local Objective-C++ Foundation harness compiled and passed real file round-trips for:
    • Application Support/scene file.glb (%20)
    • 100%-ready.glb (%25)
    • malformed, empty, and non-file URL rejection
  • edited hunk matches the repository clang-format configuration
  • bun install --frozen-lockfile
  • bun run lint
  • bun run typescript
  • bun run build
  • git diff --check

The 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: file:// URI paths not percent-decoded in RNFAppleFilamentProxy, causing silent load failure

1 participant