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

querySourceFeatures throws Uncaught TypeError in loadMatchingFeature #6555

Closed
andrewharvey opened this issue Apr 22, 2018 · 3 comments
Closed

Comments

@andrewharvey
Copy link
Collaborator

andrewharvey commented Apr 22, 2018

mapbox-gl-js version: regression in v0.45.0-beta.1, works fine on v0.44.2.

I'm labelling this as a release blocker as it seems like a pretty major bug in the beta release, please adjust if it's not. Thanks.

Steps to Trigger Behavior

http://jsbin.com/wixaxim/2/edit?html,output

start clicking some points and the error below should popup in the console

Actual Behavior

feature_index.js:163
Uncaught TypeError: Cannot read property 'decode' of undefined
    at ja.loadMatchingFeature (VM89 mapbox-gl.js:28)
    at x (VM89 mapbox-gl.js:28)
    at ja.query (VM89 mapbox-gl.js:28)
    at lt.queryRenderedFeatures (VM89 mapbox-gl.js:32)
    at at (VM89 mapbox-gl.js:32)
    at i.queryRenderedFeatures (VM89 mapbox-gl.js:32)
    at n.queryRenderedFeatures (VM89 mapbox-gl.js:32)
    at n.delegates.o.(/wixaxim/anonymous function) (https://api.tiles.mapbox.com/mapbox-gl-js/v0.45.0-beta.1/mapbox-gl.js:32:281769)
    at n.I.fire (VM89 mapbox-gl.js:28)
    at HTMLDivElement.<anonymous> (VM89 mapbox-gl.js:32)

/cc @ChrisLoer it looks related to fc992ec

@andrewharvey andrewharvey changed the title querySourceFeatures thouws Uncaught TypeError in loadMatchingFeature querySourceFeatures throws Uncaught TypeError in loadMatchingFeature Apr 22, 2018
@ChrisLoer
Copy link
Contributor

Yikes, thanks for the catch @andrewharvey! Yup, fc992ec introduced a path where vtLayers could be set by not sourceLayerIndex. Should be an easy fix.

Sorry I didn't notice this earlier, it didn't make it into my "Mention" queue -- did you edit the original post to tag me?

ChrisLoer added a commit that referenced this issue Apr 24, 2018
Fixes issue #6555 (a possible crash when calling queryRenderedFeatures after querySourceFeatures)
The actual contents of the regression test are not that important -- before this fix, the test would crash.
ChrisLoer added a commit that referenced this issue Apr 24, 2018
Fixes issue #6555 (a possible crash when calling queryRenderedFeatures after querySourceFeatures)
The actual contents of the regression test are not that important -- before this fix, the test would crash.
@andrewharvey
Copy link
Collaborator Author

Sorry I didn't notice this earlier, it didn't make it into my "Mention" queue -- did you edit the original post to tag me?

@ChrisLoer Yeah I did, I never realised that meant the notification doesn't go through.

jfirebaugh pushed a commit that referenced this issue Apr 30, 2018
* Don't load FeatureIndex#vtLayers from outside FeatureIndex code.
Fixes issue #6555 (a possible crash when calling queryRenderedFeatures after querySourceFeatures)
The actual contents of the regression test are not that important -- before this fix, the test would crash.

* Fix Tile unit test by deserializing the FeatureIndex before using it.
@jfirebaugh
Copy link
Contributor

Needs backporting to release-0.45.

@jfirebaugh jfirebaugh reopened this Apr 30, 2018
ChrisLoer added a commit that referenced this issue Apr 30, 2018
Don't load FeatureIndex#vtLayers from outside FeatureIndex code. (#6559)

* Don't load FeatureIndex#vtLayers from outside FeatureIndex code.
Fixes issue #6555 (a possible crash when calling queryRenderedFeatures after querySourceFeatures)
The actual contents of the regression test are not that important -- before this fix, the test would crash.

* Fix Tile unit test by deserializing the FeatureIndex before using it.
ChrisLoer added a commit that referenced this issue Apr 30, 2018
Don't load FeatureIndex#vtLayers from outside FeatureIndex code. (#6559)

* Don't load FeatureIndex#vtLayers from outside FeatureIndex code.
Fixes issue #6555 (a possible crash when calling queryRenderedFeatures after querySourceFeatures)
The actual contents of the regression test are not that important -- before this fix, the test would crash.

* Fix Tile unit test by deserializing the FeatureIndex before using it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants