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: remove a data race when auto-generated device id is used instead of custom device id #156

Conversation

falconandy
Copy link
Contributor

Summary

  1. Adds a new configuration option deviceId to prevent device id auto-generation.
  2. Adds a new internal setDeviceId() method that sets device id if current and expected device ids are equal.
  3. Switches amplitudeDispatcher to single thread mode
  4. Adds tests that reproduce the fixed data race.

Checklist

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

@falconandy falconandy marked this pull request as ready for review October 31, 2023 15:59
Copy link
Contributor

@justin-fiedler justin-fiedler left a comment

Choose a reason for hiding this comment

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

Thanks @falconandy. See comments.

android/src/main/java/com/amplitude/android/Amplitude.kt Outdated Show resolved Hide resolved
android/src/main/java/com/amplitude/android/Amplitude.kt Outdated Show resolved Hide resolved
@falconandy falconandy force-pushed the AMP-85977-auto-generated-device-id-instead-of-custom-device-id branch from 6ca062f to 0fa5462 Compare November 2, 2023 16:52
@justin-fiedler
Copy link
Contributor

Resolved in #177

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.

2 participants