mapbox / mapbox/mapbox-maps-ios

Unknown model file type, if uri has query: `.../sportcar.glb?hash=...`

Open
#2,067 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Xcode version: 14.3.1
- iOS version: 16.4
- Devices affected: all - tested on Simulator iPhone 14
- Maps SDK Version: 11.0.0-rc.2

## Observed behavior and steps to reproduce

I'm getting an error about identifying model file type when the uri has a query:
```
2023-11-29 11:55:11.716137+0100 RNMapboxGLExample[40604:15486260] [Mapbox] [Error, maps-core]: {}[General]: Unknown model file type: http://localhost:8081/assets/src/assets/sportcar.glb?platform=ios&hash=1357e77512d0025b300817f35c032422
```

To reproduce apply this change to `ModelLayerExample` in the Mapbox-maps-ios example app:

```diff
- static let duck = "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Embedded/Duck.gltf"
+ static let duck = "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Embedded/Duck.gltf?foo"
```

I'm getting
```log
2023-11-29 12:02:26.767027+0100 Examples[41114:15498280] [Mapbox] [Error, maps-core]: {}[General]: Unknown model file type: https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Duck/glTF-Embedded/Duck.gltf?foo
```

## Expected behavior

File extension testing should ignore the query part of the uri

## Notes / preliminary analysis

## Additional links and references

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ModelLayerExample in the Mapbox-maps-ios example app and reproduce the failure using the Duck.gltf URI with a query string. Trace the model file-type detection from that example and verify that a URI query is ignored when checking the extension, with the model loading successfully afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.