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

Fix missing location telemetry events #349

Merged
merged 2 commits into from
Sep 21, 2022
Merged

Conversation

OdNairy
Copy link
Collaborator

@OdNairy OdNairy commented Sep 21, 2022

Due to rescheduling some telemetry event to custom dispatch queue the self.locationManager getter (that includes instantiation logic) was called on the non-main queue.
CLLocationManager requires to have NSRunLoop in the constructor thread.
Instantiation in non-main queue was an unexpected change

plus:

  • minor refactoring

Fixes https://mapbox.atlassian.net/browse/CORESDK-1286

Due to rescheduling some telemetry event to custom dispatch queue
the self.locationManager getter (that includes instantiation logic)
was called on the non-main queue.
CLLocationManager requires to have NSRunLoop in the constructor
thread.
Instantiation in non-main queue was an unexpected change
Copy link

@evil159 evil159 left a comment

Choose a reason for hiding this comment

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

Great work investigating this 👍

if ([NSThread isMainThread]) {
instantiateLocationManager();
} else {
dispatch_sync(dispatch_get_main_queue(), instantiateLocationManager);
Copy link
Contributor

Choose a reason for hiding this comment

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

sweet old ObjC 🦕

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not yet deprecated 🤡

@OdNairy OdNairy merged commit b1a290c into main Sep 21, 2022
@OdNairy OdNairy deleted the bugfix/location-update-events branch September 21, 2022 13:30
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.

4 participants