-
Notifications
You must be signed in to change notification settings - Fork 205
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
Use consistent device ID for multi process apps #1013
Merged
fractalwrench
merged 1 commit into
integration/road-958-multi-process
from
PLAT-5404/device-id-persistence
Dec 1, 2020
Merged
Use consistent device ID for multi process apps #1013
fractalwrench
merged 1 commit into
integration/road-958-multi-process
from
PLAT-5404/device-id-persistence
Dec 1, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fractalwrench
force-pushed
the
PLAT-5404/device-id-persistence
branch
from
November 30, 2020 12:13
b9d47cf
to
c7f409a
Compare
Android notifier sizes
Generated by 🚫 Danger |
fractalwrench
force-pushed
the
PLAT-5404/device-id-persistence
branch
from
November 30, 2020 13:36
c7f409a
to
ce98e9c
Compare
fractalwrench
changed the title
Allow persisting consistent device ID in multi process apps
Persist consistent device ID for multi process apps
Nov 30, 2020
fractalwrench
changed the title
Persist consistent device ID for multi process apps
Use consistent device ID for multi process apps
Nov 30, 2020
fractalwrench
force-pushed
the
PLAT-5404/device-id-persistence
branch
3 times, most recently
from
November 30, 2020 15:00
708d23a
to
087e8ad
Compare
fractalwrench
force-pushed
the
PLAT-5404/device-id-persistence
branch
from
November 30, 2020 16:07
087e8ad
to
e8f6646
Compare
bugsnag-android-core/src/main/java/com/bugsnag/android/Client.java
Outdated
Show resolved
Hide resolved
bugsnag-android-core/src/main/java/com/bugsnag/android/DeviceIdStore.kt
Outdated
Show resolved
Hide resolved
fractalwrench
force-pushed
the
PLAT-5404/device-id-persistence
branch
from
December 1, 2020 09:45
e8f6646
to
ca24c6c
Compare
tomlongridge
reviewed
Dec 1, 2020
} else { | ||
return persistNewDeviceUuid(uuidProvider) | ||
} | ||
} catch (exc: Throwable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there good cause to catch Throwable
here? I would be keen to avoid this and catch more specific errors as we don't catch throwables elsewhere in the codebase. (Also the catch in persistNewDeviceUuid
is dong the same an so seem redundant.)
fractalwrench
force-pushed
the
PLAT-5404/device-id-persistence
branch
from
December 1, 2020 11:05
ca24c6c
to
82d3e19
Compare
tomlongridge
approved these changes
Dec 1, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
This changeset makes the notifier use a consistent device ID for apps which initialize Bugsnag in multiple processes. This is achieved by storing the device ID in a single file location which can be accessed concurrently from each process and is protected by a FileLock.
Changeset
DeviceIdStore
which is responsible for loading/saving the device ID to the file systemFileLock
to prevent concurrent access in multiple processes, and aReadWriteLock
to prevent concurrent access from multiple threads.Client
to persist a device ID to a file and to migrate any existing device ID fromSharedPreferences
or generating a random UUID if none already existsSharedPrefMigrator
which reads legacy information fromSharedPreferences
. A separate PR will build on this by making this class read user information too, and delete theSharedPreferences
file once the migration is completeUserRepository
SynchronizedStreamableStore
to use buffered IOTesting
Added unit test coverage for new classes, and to verify that a file lock is used. Relied on existing E2E test coverage for regression testing, and also manually tested to verify that the device ID is stored in the new location.