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

Kotlin Compiler Plugin does not tag @Composable functions #3208

Closed
audkar opened this issue Feb 2, 2024 · 2 comments · Fixed by #3209
Closed

Kotlin Compiler Plugin does not tag @Composable functions #3208

audkar opened this issue Feb 2, 2024 · 2 comments · Fixed by #3209

Comments

@audkar
Copy link
Contributor

audkar commented Feb 2, 2024

Gradle Version

8.5

AGP Version

8.2.2

Code Minifier/Optimizer

None

Version

4.2.0

Sentry SDK Version

7.3.0

Steps to Reproduce

Using androidx.compose:compose-bom:2023.10.01

Basically following docs https://docs.sentry.io/platforms/android/enhance-errors/kotlin-compiler-plugin/

  1. Add Sentry Kotlin Gradle Plugin
  2. Create simple Composable (same as in Sentry Docs). Add to Activity View Hiearary with binding.composeView.setContent { LoginScreen() }
  3. Build application gradle assembleDebug
  4. Inspect compiled output (Maybe I am missing something, but I can't find anything changed) Found the modifications in bytecode.
  5. Click an child Composable
  6. Observe logs printed by Sentry SDK (with isDebug=true): Unable to find click target. No breadcrumb captured.

Project is set up correctly. If I add testTag manually, I can see user interaction breadcrumbs logged in Sentry Web dashboard.

Expected Result

User interaction breadcrumbs are logged for Composable that do not have explicitly set testTag

Actual Result

Nothing logged

@romtsn
Copy link
Member

romtsn commented Feb 6, 2024

hey @audkar thanks for reporting, we'll take a look! When you say

Found the modifications in bytecode.

Which modifications exactly? Do you see Modifier.sentryTag() added to your modifiers chain?

Also, I assume that sentry-compose-android is also at version 7.2.0. which has this fix in there, right?

@audkar
Copy link
Contributor Author

audkar commented Feb 6, 2024

Which modifications exactly?

    const-string v3, "Asdf"

    invoke-static {v2, v3}, Lio/sentry/compose/SentryModifier;->sentryTag(Landroidx/compose/ui/Modifier;Ljava/lang/String;)Landroidx/compose/ui/Modifier;

sentry-compose-android is also at version 7.2.0.

Yes. Latest 7.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants