Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Suppress error messages for missing raster tiles #161

Closed
wants to merge 2 commits into from

Conversation

mactrem
Copy link
Contributor

@mactrem mactrem commented May 28, 2021

This PR adds explicit support for the 204 status code returned from a tileserver to get rid of
the large number of error messages in the dev console when requesting raster sources.

closes #160

Launch Checklist

  • confirm your changes do not include backports from Mapbox projects (unless with compliant license)
  • briefly describe the changes in this PR
  • include before/after visuals or gifs if this PR includes visual changes
  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the maplibre-gl-js changelog: <changelog></changelog>

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2021

Bundle size report:

Size Change: +37 B
Total Size Before: 205 kB
Total Size After: 205 kB

Output file Before After Change
maplibre-gl.js 196 kB 196 kB +37 B
maplibre-gl.css 8.87 kB 8.87 kB 0 B
ℹ️ View Details
Source file Before After Change
src/ui/map.js 6.51 kB 6.52 kB +16 B
src/util/mapbox.js 3.05 kB 3.07 kB +16 B
src/util/ajax.js 2.66 kB 2.67 kB +16 B
src/source/source_cache.js 4.04 kB 4.04 kB +5 B
src/style-spec/expression/definitions/index.js 1.69 kB 1.69 kB +1 B
src/style-spec/expression/definitions/interpolate.js 1.36 kB 1.36 kB +1 B
src/style-spec/expression/definitions/step.js 835 B 836 B +1 B
src/symbol/anchor.js 322 B 323 B +1 B
src/symbol/symbol_layout.js 4.6 kB 4.6 kB +1 B
src/geo/lng_lat.js 632 B 633 B +1 B
src/data/array_types.js 2.75 kB 2.75 kB +1 B
src/util/browser.js 517 B 516 B -1 B
src/style-spec/expression/definitions/length.js 386 B 385 B -1 B
src/source/tile.js 2.05 kB 2.04 kB -1 B
src/symbol/symbol_size.js 614 B 613 B -1 B
src/util/image.js 750 B 749 B -1 B

@lseelenbinder
Copy link
Member

Thanks @mactrem! I like the change, but it appears to have broken some unit tests.

Would you be able to take a look at the test failures and fix the failing tests?

@mactrem
Copy link
Contributor Author

mactrem commented Jun 21, 2021

Thanks @mactrem! I like the change, but it appears to have broken some unit tests.

Would you be able to take a look at the test failures and fix the failing tests?

@lseelenbinder
I have the problem that the unit tests currently are generally not executable on a windows machine. So i try to fix that first and then continue with the broken test.

@HarelM
Copy link
Collaborator

HarelM commented Jul 8, 2021

@mactrem what's the status of this PR? any chance you can fix the tests? I would like to merge this, I don't see an issue with the code as long as the tests pass.
It might be interesting to add a test to cover this case somehow...
Also don't forget to merge from main.

@HarelM
Copy link
Collaborator

HarelM commented Sep 4, 2021

We've just merged the typescript branch to main, so this basically needs to be done on the new branch as the file changed.
Once all the tests are passing please change the changelog file with this addition.
Please let us know if this is possible for you to do, I would like to get this into version 2.x.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2021

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Nov 4, 2021
@xabbu42
Copy link
Contributor

xabbu42 commented Nov 9, 2021

I rebased this branch on current main at https://github.com/xabbu42/maplibre-gl-js/tree/pull-160 and the npm run test passes. that said, I believe this fix is wrong as it treats 204 the same as 404. According to my reading of https://github.com/opengeospatial/ogcapi-tiles/blob/master/core/standard/requirements/core/REQ_tc-success.adoc it should be treated like an empty image with a 200 http result code. I also would expect 204 to be handled as an empty but existing vector tile for vector layers, same as 200 http result code with a content-length of 0.

@HarelM
Copy link
Collaborator

HarelM commented Nov 9, 2021

I'm not sure what are you suggesting @xabbu42, if you think this is not the right direction in terms of fixing this issue we can and should reject this PR.
I don't have strong feelings wither way...

@xabbu42
Copy link
Contributor

xabbu42 commented Nov 9, 2021

After reading through mapbox/mapbox-gl-js#1800 this seems to actually implement the approach favored there, that is use 204 instead of 404 explicitely to allow for missing tiles (and the according behaviour of maplibre-gl-js to fall back on other zoom levels etc) without triggering the browser loging of 404.

@xabbu42
Copy link
Contributor

xabbu42 commented Nov 9, 2021

@HarelM I'm not suggesting anything yet as I'm still confused on the situation myself. My gut feeling would be that 204 should be equivalent to 200 with content-length 0 at least for vector tiles. I can see the logic behind treating 204 as an empty image for raster tiles. But the discussion in the mapbox issue seems to disagree with this takes.

@xabbu42
Copy link
Contributor

xabbu42 commented Nov 9, 2021

In the end compatiblity to other products fetching tiles is probably the most important concern here. So this pull request should only make it in if other consumers and especially mapbox-gl-js 2.x have the same behavior, that is they also fallback to higher zoomlevels on 204 responses.

@HarelM
Copy link
Collaborator

HarelM commented Nov 9, 2021

I see, thanks for the clarification!

@github-actions github-actions bot removed the stale label Nov 10, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2022

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Jan 9, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2022

This PR was closed because it has been stalled for 30 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suppress error messages for missing raster tiles
5 participants