Skip to content

fix(spring): [Data Collection 18] Bind key-value policies#5834

Draft
adinauer wants to merge 1 commit into
fix/data-collection-android-installation-idfrom
fix/data-collection-spring-binding
Draft

fix(spring): [Data Collection 18] Bind key-value policies#5834
adinauer wants to merge 1 commit into
fix/data-collection-android-installation-idfrom
fix/data-collection-spring-binding

Conversation

@adinauer

@adinauer adinauer commented Jul 24, 2026

Copy link
Copy Markdown
Member

PR Stack (Data Collection)


📜 Description

Make KeyValueCollectionBehavior JavaBean-bindable so Spring Boot can configure Data Collection policies for cookies, URL query parameters, and request/response headers.

Add a public no-argument constructor with the default deny-list behavior and setters for mode and terms. The existing off, denyList, and allowList factories remain available, and terms continue to be defensively copied into an immutable list.

💡 Motivation and Context

Spring Boot could bind scalar Data Collection fields but silently ignored nested key-value policies because KeyValueCollectionBehavior only exposed private construction and immutable fields. A scalar property could therefore make the namespace explicit while the requested cookie, query, or header restriction was not applied.

Refs #5666

💚 How did you test it?

  • ./gradlew :sentry:test --tests io.sentry.KeyValueCollectionBehaviorTest :sentry-spring-boot:test --tests 'io.sentry.spring.boot.SentryAutoConfigurationTest.data collection key value properties are applied to SentryOptions' :sentry-spring-boot-jakarta:test --tests 'io.sentry.spring.boot.jakarta.SentryAutoConfigurationTest.data collection key value properties are applied to SentryOptions' :sentry-spring-boot-4:test --tests 'io.sentry.spring.boot4.SentryAutoConfigurationTest.data collection key value properties are applied to SentryOptions'
  • ./gradlew spotlessApply apiDump
  • 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

Add the remaining external and Android manifest Data Collection configuration paths.

#skip-changelog

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

Make KeyValueCollectionBehavior JavaBean-bindable so Spring Boot properties correctly configure cookie, header, and query policies. Cover binding across all supported Spring Boot generations.

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

sentry Bot commented Jul 24, 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 366.32 ms 435.63 ms 69.31 ms
Size 0 B 0 B 0 B

Baseline results on branch: fix/data-collection-android-installation-id

Startup times

Revision Plain With Sentry Diff
9c0d3ce 412.04 ms 489.67 ms 77.63 ms

App size

Revision Plain With Sentry Diff
9c0d3ce 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