Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tags missing for compose view hierarchies #4275

Merged
merged 14 commits into from
Mar 28, 2025

Conversation

markushi
Copy link
Member

📜 Description

Only on newer versions of Jetpack Compose

💡 Motivation and Context

Fixes #4273

💚 How did you test it?

📝 Checklist

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

🔮 Next steps

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Contributor

github-actions bot commented Mar 21, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 439.98 ms 460.60 ms 20.62 ms
Size 1.58 MiB 2.22 MiB 655.17 KiB

Previous results on branch: markushi/fix/compose-view-hierarchy-exporter

Startup times

Revision Plain With Sentry Diff
eb39954 436.12 ms 493.80 ms 57.68 ms
f63778b 413.88 ms 482.02 ms 68.14 ms
6f1848f 384.70 ms 441.52 ms 56.82 ms
ec2f9cd 390.96 ms 418.91 ms 27.95 ms
261e725 389.22 ms 417.14 ms 27.92 ms
b159a6d 378.41 ms 464.32 ms 85.91 ms

App size

Revision Plain With Sentry Diff
eb39954 1.58 MiB 2.22 MiB 652.89 KiB
f63778b 1.58 MiB 2.22 MiB 652.84 KiB
6f1848f 1.58 MiB 2.22 MiB 652.90 KiB
ec2f9cd 1.58 MiB 2.22 MiB 655.17 KiB
261e725 1.58 MiB 2.22 MiB 655.17 KiB
b159a6d 1.58 MiB 2.22 MiB 653.07 KiB

@@ -99,6 +105,21 @@ private static void setTag(
}
}
}
} else if ("androidx.compose.ui.platform.TestTagElement".equals(type)
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to test it with robolectric/instrumented tests to avoid regressions in future?

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

would be nice to have tests for this (and extract that logic into a separate class if possible), but LGTM otherwise!

return value as String?
}
} catch (e: Throwable) {
// ignored
Copy link
Member

Choose a reason for hiding this comment

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

maybe worth to add a debug log here so we can troubleshoot easier?

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM again, but these two comments I guess would be nice to address: https://github.com/getsentry/sentry-java/pull/4275/files#r2014326540

Great tests btw, and very happy to get rid of that workaround with the java-only module

@markushi markushi merged commit 5b39391 into main Mar 28, 2025
35 checks passed
@markushi markushi deleted the markushi/fix/compose-view-hierarchy-exporter branch March 28, 2025 10:00
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.

View Hierarchy for Compose testTag stopped working
3 participants