Skip to content

fix(android): [Logs and Metrics Enable Flags 13] Read Timber option lazily - #5964

Open
adinauer wants to merge 9 commits into
docs/update-options-guidancefrom
fix/timber-lazy-logs-option
Open

adinauer wants to merge 9 commits into
docs/update-options-guidancefrom
fix/timber-lazy-logs-option

Conversation

@adinauer

@adinauer adinauer commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Logs and Metrics Enable Flags)


📜 Description

Makes the auto-installed Timber integration resolve timberLogsEnabled lazily when the integration registers rather than snapshotting it while Android default integrations are constructed.

This honors the final option value after the Android configuration callback, including both programmatic opt-in and programmatic override of manifest configuration. Existing boolean constructors continue to behave as fixed values for manually installed integrations.

💡 Motivation and Context

Android installs default integrations before invoking the user's options callback so users can remove or replace them. Passing the current boolean value into Timber at that earlier point caused later programmatic configuration to be ignored.

💚 How did you test it?

  • ./gradlew :sentry-android-timber:testReleaseUnitTest :sentry-android-core:testReleaseUnitTest
  • ./gradlew spotlessApply apiDump
  • Added full Android initialization tests for callback false -> true and manifest true -> callback false
  • Added an integration-level test proving the supplier is evaluated at registration

📝 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.

#skip-changelog

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

This was referenced Aug 13, 2026
Resolve the auto-installed Timber integration's Logs opt-in lazily when the integration registers. This honors programmatic configuration and manifest overrides applied after default integrations are constructed.

Co-Authored-By: Claude <noreply@anthropic.com>
@adinauer
adinauer force-pushed the fix/timber-lazy-logs-option branch from d7c56cc to 6e791e5 Compare August 13, 2026 11:46
@sentry

sentry Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 377.30 ms 438.92 ms 61.62 ms
Size 0 B 0 B 0 B

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4d120ff. Configure here.

@lbloder lbloder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👍

@adinauer adinauer changed the title fix(android): [Logs and Metrics Enable Flags 19] Read Timber option lazily fix(android): [Logs and Metrics Enable Flags 13] Read Timber option lazily Sep 30, 2026
adinauer and others added 4 commits September 30, 2026 14:59
Hide the lazy evaluator constructor from the supported Kotlin API while
retaining Java access for Android integration wiring. Use a lambda instead
of a method reference for compatibility with older Android Gradle plugins.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer added a commit that referenced this pull request Oct 1, 2026
Merge the latest Timber lazy-option fixes from PR #5964 into the stack
tip. Preserve the renamed capture options and revised constructor API
while retaining the internal lazy constructor and lambda wiring.

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

This branch has not been deployed

No deployments
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