Skip to content

Prepare SDK for upcoming Session Replay API changes on Android #2977

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

markushi
Copy link
Member

@markushi markushi commented Jun 4, 2025

📜 Description

As it may takes some time until the first frame is drawn, we're removing the replay configuration from the .start() call, instead the Android SDK expects onConfigurationChanged() to be called every time the top level widget size changes.

Example replay: https://sentry-sdks.sentry.io/replays/3f571c24990e4bb998b49eebef745313

The breaking changes were introduced in sentry-java 8.13.3

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Contributor

github-actions bot commented Jun 4, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Prepare SDK for upcoming Session Replay API changes on Android ([#2977](https://github.com/getsentry/sentry-dart/pull/2977))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against ad96a76

Copy link
Contributor

github-actions bot commented Jun 4, 2025

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt
  • flutter/lib/src/native/java/android_replay_recorder.dart
  • flutter/lib/src/screenshot/recorder.dart

Copy link

codecov bot commented Jun 4, 2025

Codecov Report

Attention: Patch coverage is 91.48936% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.12%. Comparing base (b38106d) to head (ad96a76).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
flutter/lib/src/screenshot/recorder.dart 60.00% 2 Missing ⚠️
...r/lib/src/native/java/android_replay_recorder.dart 50.00% 1 Missing ⚠️
...lutter/lib/src/native/java/sentry_native_java.dart 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2977      +/-   ##
==========================================
+ Coverage   87.62%   89.12%   +1.49%     
==========================================
  Files         278       93     -185     
  Lines        9175     3098    -6077     
==========================================
- Hits         8040     2761    -5279     
+ Misses       1135      337     -798     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@markushi markushi changed the title Prepare SDK for upcoming Android changes Prepare SDK for upcoming Session Replay API changes on Android Jun 4, 2025
Copy link
Contributor

github-actions bot commented Jun 4, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1267.79 ms 1285.04 ms 17.25 ms
Size 8.43 MiB 9.99 MiB 1.56 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
bf8d36c 1238.33 ms 1258.71 ms 20.38 ms
136c365 1248.12 ms 1277.33 ms 29.20 ms
3f3ef0b 1223.73 ms 1237.67 ms 13.94 ms
dfbe468 1250.73 ms 1275.61 ms 24.88 ms
ef6466d 1209.88 ms 1225.81 ms 15.93 ms
30c1193 1227.20 ms 1235.00 ms 7.80 ms
6ec7b50 1239.61 ms 1268.93 ms 29.32 ms
3e4b523 1260.53 ms 1270.06 ms 9.53 ms
21d4150 1252.86 ms 1280.55 ms 27.69 ms
6f3717a 1259.84 ms 1280.90 ms 21.06 ms

App size

Revision Plain With Sentry Diff
bf8d36c 8.38 MiB 9.74 MiB 1.36 MiB
136c365 8.38 MiB 9.75 MiB 1.37 MiB
3f3ef0b 8.32 MiB 9.38 MiB 1.05 MiB
dfbe468 8.43 MiB 10.01 MiB 1.58 MiB
ef6466d 8.33 MiB 9.40 MiB 1.07 MiB
30c1193 8.28 MiB 9.34 MiB 1.06 MiB
6ec7b50 8.38 MiB 9.75 MiB 1.37 MiB
3e4b523 8.28 MiB 9.33 MiB 1.05 MiB
21d4150 8.16 MiB 9.17 MiB 1.01 MiB
6f3717a 8.33 MiB 9.62 MiB 1.29 MiB

@romtsn romtsn requested a review from vaind June 4, 2025 11:27

if (width == 0.0 || height == 0.0 || windowWidth == 0.0 || windowHeight == 0.0) {
result.error(
"5",
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if result.error must be processed, but I added it to prevent any division by zero

return;
}

assert(config.frameRate > 0);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is kind-of ugly as super.config is nullable, but config isn't

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.

1 participant