Skip to content

feat(user): [Data Collection 14] Apply user information policy#5812

Draft
adinauer wants to merge 1 commit into
feat/data-collection-cookiesfrom
feat/data-collection-user-info
Draft

feat(user): [Data Collection 14] Apply user information policy#5812
adinauer wants to merge 1 commit into
feat/data-collection-cookiesfrom
feat/data-collection-user-info

Conversation

@adinauer

@adinauer adinauer commented Jul 22, 2026

Copy link
Copy Markdown
Member

PR Stack (Data Collection)


📜 Description

Apply the user information Data Collection policy to automatic identity enrichment across core, Android, and Spring integrations.

The policy controls automatic {{auto}} IP addresses, Spring request and Spring Security usernames, and SDK-generated Android installation identifiers written to user.id and device.id. Explicit userInfo=false suppresses these automatic values, while application-supplied user data and custom SentryUserProvider values remain untouched.

When Data Collection is absent, existing behavior is preserved: sendDefaultPii continues to control automatic IP and Spring user enrichment, while Android installation identifiers remain enabled. The unused private TraceContext user-ID helper is removed without changing generated trace context data.

💡 Motivation and Context

Automatic user identity fields can contain personal or stable identifying data. This wires the existing dataCollection.userInfo option to all supported Java and Android collectors while preserving the legacy bridge for applications that have not configured Data Collection.

Refs #5666

💚 How did you test it?

  • ./gradlew spotlessApply apiDump
  • ./gradlew :sentry:apiCheck
  • Core resolver and event processor tests
  • Android event processor, device information, exit-info, and internal SDK tests
  • Spring, Spring Jakarta, and Spring 7 request/Security user-provider tests
  • git diff --check

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Complete the remaining Data Collection configuration, documentation, and migration work.

#skip-changelog

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

Gate automatic user and device identity enrichment across core, Android, and Spring integrations with the Data Collection policy. Preserve legacy sendDefaultPii and Android installation identity behavior when Data Collection is absent.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
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:

  • sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java

@github-actions

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against a0d6c1c

@sentry

sentry Bot commented Jul 22, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.48.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 341.50 ms 364.64 ms 23.14 ms
Size 0 B 0 B 0 B

Baseline results on branch: feat/data-collection-cookies

Startup times

Revision Plain With Sentry Diff
b0be236 316.30 ms 372.60 ms 56.30 ms

App size

Revision Plain With Sentry Diff
b0be236 0 B 0 B 0 B

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.

1 participant