fix(android): [Data Collection 19] Preserve installation ID - #5937
Draft
adinauer wants to merge 1 commit into
Draft
fix(android): [Data Collection 19] Preserve installation ID#5937adinauer wants to merge 1 commit into
adinauer wants to merge 1 commit into
Conversation
Keep the Android installation ID available for distinct ID, user ID, device ID, and hybrid scope fallbacks regardless of the userInfo setting. Continue applying userInfo only to automatic user details such as IP addresses and remove the now-unused legacy-always resolver variant. Refs #5666 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
This was referenced Aug 12, 2026
📲 Install BuildsAndroid
|
This file contains hidden or 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
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.
PR Stack (Data Collection)
📜 Description
Keep Android's generated installation ID independent of the Data Collection
userInfooption.Restore installation IDs for the default
distinctId, event and exit-infouser.id, device contextdevice.id, and hybrid scope serialization whenuserInfo=false. Application-configured user and distinct IDs remain authoritative. Automatic IP enrichment continues to followuserInfo.Remove the now-unused
isUserInfoWithLegacyAlways()resolver variant and update the Android policy tests.💡 Motivation and Context
The installation ID is a random identifier generated once per app installation and historically remains available independently of
sendDefaultPii. The Data Collection specification definesuserInfoaround automatic user information, but does not require it to control installation identity, device identity, or session correlation.Keeping the installation ID independent preserves existing Android behavior and avoids changing crash-free user, session, log, metric, device-context, and hybrid SDK correlation when applications opt out of automatic user information.
Refs #5666
💚 How did you test it?
./gradlew ':sentry-android-core:testDebugUnitTest' --tests='*AndroidOptionsInitializerTest*' --tests='*ApplicationExitInfoEventProcessorTest*' --tests='*DefaultAndroidEventProcessorTest*' --tests='*DeviceInfoUtilTest*' --tests='*InternalSentrySdkTest*'./gradlew ':sentry:test' --tests='*DataCollectionResolverTest*'./gradlew spotlessApply apiDumpgit diff --check📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue the remaining Data Collection configuration and release-gate work.
#skip-changelog