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: mark trackingoptions as atomic to prevent issues from concurrent access #499

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

crleona
Copy link
Collaborator

@crleona crleona commented Jul 25, 2024

Summary

I've been able to reproduce the crash mentioned in #498 with the following initialization:

let amp = Amplitude.instance(withName: "foo")
amp.initializeApiKey("...")
amp.logEvent("test")
DispatchQueue.global().async {
     while true {
          amp.setTrackingOptions(AMPTrackingOptions().disableLatLng())
     }
}    

It seems this is caused by concurrent access to tracking options, so I've marked the related variables as atomic.

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: no

@crleona crleona merged commit 83465ed into main Jul 26, 2024
2 checks passed
@crleona crleona deleted the AMP-105317-fix-trackingoptions-crash branch July 26, 2024 18:06
github-actions bot pushed a commit that referenced this pull request Aug 5, 2024
## [8.19.3](v8.19.2...v8.19.3) (2024-08-05)

### Bug Fixes

* mark trackingoptions as atomic to prevent issues from concurrent access ([#499](#499)) ([83465ed](83465ed))
Copy link

github-actions bot commented Aug 5, 2024

🎉 This PR is included in version 8.19.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants