-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Conversation
🚨 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:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2977 +/- ##
==========================================
+ Coverage 87.91% 89.14% +1.23%
==========================================
Files 287 97 -190
Lines 9766 3539 -6227
==========================================
- Hits 8586 3155 -5431
+ Misses 1180 384 -796 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
iOS Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
b6c8720 | 1252.65 ms | 1266.61 ms | 13.96 ms |
6f47800 | 1247.52 ms | 1259.37 ms | 11.85 ms |
640ad0c | 1241.04 ms | 1253.96 ms | 12.92 ms |
73a3c38 | 1263.37 ms | 1277.90 ms | 14.53 ms |
73dca78 | 1246.65 ms | 1265.42 ms | 18.76 ms |
6ba4675 | 1223.12 ms | 1238.17 ms | 15.04 ms |
93b7728 | 1247.23 ms | 1264.87 ms | 17.64 ms |
2d34233 | 1258.19 ms | 1268.92 ms | 10.73 ms |
ec78888 | 1251.37 ms | 1269.40 ms | 18.04 ms |
dbd526b | 1244.78 ms | 1259.02 ms | 14.24 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
b6c8720 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
6f47800 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
640ad0c | 7.86 MiB | 9.44 MiB | 1.58 MiB |
73a3c38 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
73dca78 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
6ba4675 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
93b7728 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
2d34233 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
ec78888 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
dbd526b | 7.86 MiB | 9.44 MiB | 1.58 MiB |
Previous results on branch: markushi/feat/android-replay-api-changes
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
7267eb0 | 1249.64 ms | 1270.31 ms | 20.67 ms |
935def9 | 1260.27 ms | 1267.14 ms | 6.87 ms |
32ffe84 | 1265.10 ms | 1278.28 ms | 13.18 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
7267eb0 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
935def9 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
32ffe84 | 7.86 MiB | 9.44 MiB | 1.58 MiB |
flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt
Show resolved
Hide resolved
…kushi/feat/android-replay-api-changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, only thing is changelog is still missing
07c0eb3
to
94ca61e
Compare
6fcd250
to
7d97873
Compare
Tested locally in release mode, works well |
bugbot run |
@sentry review |
flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Scheduler Bugs: Division by Zero, Null Cast
The ScheduledScreenshotRecorder._restartScheduler
method contains two bugs:
- Division by zero: Calculating
frameDuration
divides byconfig.frameRate
. Ifconfig.frameRate
is 0 (which the Android plugin can pass, is not validated, and the existing assert is disabled in release mode), a division by zero occurs. - Null cast exception: After
super.config
is checked for null and the method returns early, subsequent code uses theconfig
getter. This getter performs an unsafe cast (super.config as ScheduledScreenshotRecorderConfig
), leading to aNull cast exception
ifsuper.config
was null.
flutter/lib/src/replay/scheduled_recorder.dart#L73-L79
sentry-dart/flutter/lib/src/replay/scheduled_recorder.dart
Lines 73 to 79 in 79502a8
if (super.config == null) { | |
return; | |
} | |
assert(config.frameRate > 0); | |
var frameDuration = Duration(milliseconds: 1000 ~/ config.frameRate); |
Was this report helpful? Give feedback by reacting with 👍 or 👎
📜 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 expectsonConfigurationChanged()
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
sendDefaultPii
is enabled🔮 Next steps