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

Don't load FeatureIndex#vtLayers from outside FeatureIndex code. #6559

Merged
merged 2 commits into from
Apr 30, 2018

Conversation

ChrisLoer
Copy link
Contributor

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.

The problem was that vtLayers would be loaded without loading the sourceLayerCoder, and the FeatureIndex would assume both were loaded if vtLayers was loaded.

I've checked and this doesn't appear to have an analog on gl-native.

/cc @ansis @mollymerp @andrewharvey

@ChrisLoer ChrisLoer requested a review from ansis April 24, 2018 22:39
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
Copy link
Contributor Author

I fixed the Tile unit test by switching to using a deserialized version of the FeatureIndex/CollisionBoxArray (necessary because querySourceFeature now needs to call the loadVTLayers method of FeatureIndex). I looked back a ways through the commit history and didn't figure out why we were using a serialized version in the first place, but I kept a serialize/deserialize round trip so that the unit test still exercises some of the expected pathway for data being provided by the web workers.

Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@jfirebaugh jfirebaugh merged commit 3df26a8 into master Apr 30, 2018
@jfirebaugh jfirebaugh deleted the cloer-6555 branch April 30, 2018 20:02
@jfirebaugh
Copy link
Contributor

@ChrisLoer Can you please backport this to the 0.45 release branch?

ChrisLoer added a commit that referenced this pull request 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 pull request 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants