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

no-op if geolocation query returns after control has been removed #12332

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

tmcw
Copy link
Contributor

@tmcw tmcw commented Oct 24, 2022

Launch Checklist

As described in the linked issue, there's a race condition in which a map can be set up, a geolocate control added, and then removed before the geolocate control's query for geolocation support finishes, which will throw an error. This PR fixes that race condition by making _setupUI a no-op if the a map is no longer attached to the control.

  • briefly describe the changes in this PR
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fix an issue where Geolocate control would throw an error if it's removed before determining geolocation support</changelog>

@tmcw tmcw requested a review from a team as a code owner October 24, 2022 17:11
@CLAassistant
Copy link

CLAassistant commented Oct 24, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

Nice to see you here Tom, and thanks for the contribution!

@stepankuzmin stepankuzmin merged commit 91efc40 into mapbox:main Oct 25, 2022
MinhOmega added a commit to MinhOmega/mapbox-gl that referenced this pull request Mar 13, 2024
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.

Race condition between GeolocateControl and map removal
4 participants