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

[SR] Send replay recording options #4015

Merged
merged 21 commits into from
Dec 30, 2024

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Dec 30, 2024

📜 Description

  • Send replay recording options so they can show up on the replay Tags tab and help us in debugging customers' issues

💡 Motivation and Context

Part of getsentry/sentry#74441

Google Chrome 2024-12-30 17 14 18

💚 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

From the hybrid's side it's possible to intercept and change this event in their favour as follows:

options.beforeSendReplay = SentryOptions.BeforeSendReplayCallback { event, hint ->
    val optionsEvent = hint.replayRecording
        ?.payload
        ?.find { it is RRWebOptionsEvent }
    (optionsEvent as? RRWebOptionsEvent)?.optionsPayload?.put("custom_key", "custom_value")
    event
}

Copy link
Contributor

github-actions bot commented Dec 30, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 375.98 ms 412.40 ms 36.42 ms
Size 1.70 MiB 2.36 MiB 672.20 KiB

Previous results on branch: rz/feat/session-replay-recording-options

Startup times

Revision Plain With Sentry Diff
f970a1a 554.73 ms 618.51 ms 63.78 ms

App size

Revision Plain With Sentry Diff
f970a1a 1.70 MiB 2.36 MiB 672.31 KiB

Copy link
Member

@stefanosiano stefanosiano left a comment

Choose a reason for hiding this comment

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

nice!

assertEquals(true, optionsEvent[0].optionsPayload["maskAllText"])
assertEquals(false, optionsEvent[0].optionsPayload["maskAllImages"])
assertEquals("high", optionsEvent[0].optionsPayload["quality"])
assertEquals("android.widget.TextView,android.webkit.WebView,android.widget.VideoView,androidx.media3.ui.PlayerView,com.google.android.exoplayer2.ui.PlayerView,com.google.android.exoplayer2.ui.StyledPlayerView,my.custom.View", optionsEvent[0].optionsPayload["maskedViewClasses"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

AFAIU from your definition of optionsPayload value, we could add a list here instead of a concatenated string. Would it make sense to do this by default so we can potentially have a better UI for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah just tried it and it looks fine! I will ask about the frontend change
Google Chrome 2024-12-30 23 07 44

Base automatically changed from rz/feat/session-replay-override-sdk-version to main December 30, 2024 21:42
@romtsn romtsn enabled auto-merge (squash) December 30, 2024 22:17
@romtsn romtsn merged commit 9aa5279 into main Dec 30, 2024
32 of 33 checks passed
@romtsn romtsn deleted the rz/feat/session-replay-recording-options branch December 30, 2024 22:35
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.

3 participants