Skip to content

fix(replay): Mask the whole Compose view when traversing it fails (JAVA-552) - #6679

Draft
runningcode wants to merge 1 commit into
9.x.xfrom
no/java-552-replay-masking-fail-closed
Draft

runningcode wants to merge 1 commit into
9.x.xfrom
no/java-552-replay-masking-fail-closed

Conversation

@runningcode

@runningcode runningcode commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

When the Compose tree of a view can't be traversed, for example with an unsupported Compose version, ComposeViewHierarchyNode.fromView returned false. The view was then walked as a plain ViewGroup. Its children don't include the composables, so their text and images were recorded unmasked.

The whole Compose view is now masked instead. Screenshot masking uses the same traversal, so it fails closed too.

This happens on 9.x.x today for any traversal failure, independently of the other PRs. #6666 makes one more failure reach this path: a LinkageError from findPainter now aborts the traversal instead of being swallowed.

This PR changes 1 site, the traversal catch in fromView. #6666 also changes that catch, to handle LinkageError first. The two PRs edit different lines of it.

💡 Motivation and Context

This is part of the catch (Throwable) audit. A review of #6666 asked what happens to the frame when the Compose traversal fails.

This PR is independent of its siblings and they can merge in any order:

💚 How did you test it?

  • The existing unit tests of sentry-android-replay, plus detekt.

📝 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

The changelog entry for the whole set is in #6665.

#skip-changelog

🤖 Generated with Claude Code

When the Compose tree can't be traversed, for example with an unsupported Compose version, fromView returned false. The view was then walked as a plain ViewGroup, whose children don't include the composables, so their text and images were recorded unmasked. The whole Compose view is now masked instead. Screenshot masking shares this traversal, so it fails closed too.

Refs #5513

Refs JAVA-552

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

JAVA-552

@sentry

sentry Bot commented Nov 19, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

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

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant