'errored' tiles can transition to 'reloading' without first loading data
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
The "renderable" states for a tile are supposed to be: `loaded`/`reloading`/`expired`:
https://github.com/mapbox/mapbox-gl-js/blob/6465c04107f34dceb2c16bfd824fdf8c3380fc53/src/source/tile.js#L402-L404
When we reload a tile, we avoid entering the `reloading` state if we're in the middle of loading a tile:
https://github.com/mapbox/mapbox-gl-js/blob/6465c04107f34dceb2c16bfd824fdf8c3380fc53/src/source/source_cache.js#L229-L235
However, if a tile fails to load (ie, it enters the `errored`) state, a reload request will transition the tile straight to `reloading`. We will start trying to render the tile, which turns out not to cause much trouble, because the tile won't have any data and the rendering will essentially be a no-op. However, because the tile appears to be renderable, we'll stop using _actually_ loaded parents or child tiles that we might have been using in its place.
I can imagine this leading to somewhat surprising behavior with data sources that use 404s to indicate unavailable tiles. The map could initially load with an appropriate mix of available tiles (from different zoom levels). Then some runtime styling operation could trigger tile reloading, and all of a sudden gaps would open up in the map where the 404'd ideal tiles were.
This doesn't seem to be a very important bug -- I just wanted to get it documented.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked sections in src/source/tile.js and src/source/source_cache.js, tracing the transition from errored through a reload request. Check existing tile and source-cache tests before reproducing the 404 scenario. Done means errored tiles do not become renderable during reload, while loaded parent or child fallback behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100