-
-
Notifications
You must be signed in to change notification settings - Fork 355
fix(replay): Preserve interaction spans during app restart to fix replay capture #5386
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
Merged
+77
−5
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5ee3314+dirty | 358.69 ms | 394.00 ms | 35.31 ms |
| 88890fe+dirty | 328.30 ms | 319.85 ms | -8.45 ms |
| c7f264b+dirty | 356.98 ms | 407.46 ms | 50.48 ms |
| e2fa43d+dirty | 326.56 ms | 372.88 ms | 46.32 ms |
| e07935d+dirty | 380.10 ms | 377.48 ms | -2.62 ms |
| af9331b+dirty | 374.42 ms | 425.68 ms | 51.26 ms |
| 4167e15+dirty | 311.62 ms | 336.91 ms | 25.29 ms |
| 2b89ce9+dirty | 372.22 ms | 417.06 ms | 44.84 ms |
| 4604da9+dirty | 292.27 ms | 314.16 ms | 21.90 ms |
| d751a5d+dirty | 341.61 ms | 403.06 ms | 61.45 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5ee3314+dirty | 7.15 MiB | 8.43 MiB | 1.28 MiB |
| 88890fe+dirty | 7.15 MiB | 8.44 MiB | 1.28 MiB |
| c7f264b+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| e2fa43d+dirty | 7.15 MiB | 8.42 MiB | 1.27 MiB |
| e07935d+dirty | 43.94 MiB | 48.82 MiB | 4.88 MiB |
| af9331b+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| 4167e15+dirty | 7.15 MiB | 8.46 MiB | 1.30 MiB |
| 2b89ce9+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
| 4604da9+dirty | 7.15 MiB | 8.46 MiB | 1.31 MiB |
| d751a5d+dirty | 7.15 MiB | 8.41 MiB | 1.26 MiB |
Previous results on branch: antonis/fix-replay-capture-during-app-restart
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 145273c+dirty | 367.51 ms | 389.36 ms | 21.85 ms |
| 28c74e7+dirty | 385.33 ms | 421.10 ms | 35.78 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 145273c+dirty | 43.94 MiB | 48.85 MiB | 4.91 MiB |
| 28c74e7+dirty | 43.94 MiB | 48.85 MiB | 4.91 MiB |
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 161947d+dirty | 393.26 ms | 403.00 ms | 9.74 ms |
| 20daa0a | 359.51 ms | 374.90 ms | 15.39 ms |
| e07935d+dirty | 448.82 ms | 489.10 ms | 40.29 ms |
| 2b89ce9 | 413.69 ms | 442.58 ms | 28.89 ms |
| 8d89cc9+dirty | 537.83 ms | 536.02 ms | -1.81 ms |
| 459a438+dirty | 417.09 ms | 406.52 ms | -10.57 ms |
| 23080e5 | 384.85 ms | 382.57 ms | -2.28 ms |
| 3e0a5f9 | 401.72 ms | 394.98 ms | -6.74 ms |
| c4e097a | 338.06 ms | 439.36 ms | 101.30 ms |
| 21c9e75 | 450.39 ms | 452.92 ms | 2.53 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 161947d+dirty | 17.75 MiB | 19.70 MiB | 1.95 MiB |
| 20daa0a | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| e07935d+dirty | 43.75 MiB | 47.99 MiB | 4.24 MiB |
| 2b89ce9 | 17.75 MiB | 19.68 MiB | 1.94 MiB |
| 8d89cc9+dirty | 17.75 MiB | 19.68 MiB | 1.94 MiB |
| 459a438+dirty | 17.75 MiB | 19.70 MiB | 1.95 MiB |
| 23080e5 | 17.75 MiB | 19.68 MiB | 1.94 MiB |
| 3e0a5f9 | 17.75 MiB | 20.15 MiB | 2.41 MiB |
| c4e097a | 17.75 MiB | 19.68 MiB | 1.94 MiB |
| 21c9e75 | 17.75 MiB | 20.15 MiB | 2.41 MiB |
Previous results on branch: antonis/fix-replay-capture-during-app-restart
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 145273c+dirty | 422.73 ms | 439.27 ms | 16.54 ms |
| 28c74e7+dirty | 405.00 ms | 414.74 ms | 9.74 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 145273c+dirty | 43.75 MiB | 48.02 MiB | 4.27 MiB |
| 28c74e7+dirty | 43.75 MiB | 48.02 MiB | 4.27 MiB |
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| e2fa43d+dirty | 1216.04 ms | 1232.65 ms | 16.61 ms |
| 083f560+dirty | 1227.33 ms | 1242.02 ms | 14.69 ms |
| c4e097a+dirty | 1229.09 ms | 1242.61 ms | 13.53 ms |
| df83aad+dirty | 1187.20 ms | 1190.55 ms | 3.36 ms |
| af9331b+dirty | 1233.61 ms | 1230.50 ms | -3.11 ms |
| 8d89cc9+dirty | 1222.92 ms | 1239.43 ms | 16.51 ms |
| 955f2eb+dirty | 1235.06 ms | 1253.88 ms | 18.81 ms |
| 652f785+dirty | 1219.66 ms | 1223.62 ms | 3.96 ms |
| 818a608+dirty | 1205.76 ms | 1208.00 ms | 2.24 ms |
| 136effd+dirty | 1211.60 ms | 1218.33 ms | 6.72 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| e2fa43d+dirty | 2.63 MiB | 3.81 MiB | 1.18 MiB |
| 083f560+dirty | 2.63 MiB | 4.00 MiB | 1.36 MiB |
| c4e097a+dirty | 2.63 MiB | 3.87 MiB | 1.24 MiB |
| df83aad+dirty | 3.41 MiB | 4.57 MiB | 1.16 MiB |
| af9331b+dirty | 2.63 MiB | 3.91 MiB | 1.28 MiB |
| 8d89cc9+dirty | 2.63 MiB | 3.96 MiB | 1.33 MiB |
| 955f2eb+dirty | 2.63 MiB | 3.98 MiB | 1.35 MiB |
| 652f785+dirty | 3.41 MiB | 4.57 MiB | 1.16 MiB |
| 818a608+dirty | 2.63 MiB | 3.91 MiB | 1.28 MiB |
| 136effd+dirty | 3.41 MiB | 4.57 MiB | 1.16 MiB |
Previous results on branch: antonis/fix-replay-capture-during-app-restart
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 28c74e7+dirty | 1216.27 ms | 1213.66 ms | -2.61 ms |
| 145273c+dirty | 1184.73 ms | 1192.98 ms | 8.24 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 28c74e7+dirty | 3.41 MiB | 4.58 MiB | 1.17 MiB |
| 145273c+dirty | 3.41 MiB | 4.58 MiB | 1.17 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| e2fa43d+dirty | 1224.43 ms | 1235.40 ms | 10.98 ms |
| 083f560+dirty | 1215.27 ms | 1231.96 ms | 16.69 ms |
| c4e097a+dirty | 1231.35 ms | 1246.91 ms | 15.56 ms |
| df83aad+dirty | 1202.06 ms | 1203.83 ms | 1.77 ms |
| af9331b+dirty | 1230.08 ms | 1233.24 ms | 3.16 ms |
| 8d89cc9+dirty | 1232.35 ms | 1228.53 ms | -3.82 ms |
| 955f2eb+dirty | 1225.78 ms | 1239.27 ms | 13.49 ms |
| 652f785+dirty | 1216.42 ms | 1212.21 ms | -4.21 ms |
| 818a608+dirty | 1218.84 ms | 1223.18 ms | 4.34 ms |
| 136effd+dirty | 1214.53 ms | 1223.67 ms | 9.13 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| e2fa43d+dirty | 3.19 MiB | 4.38 MiB | 1.19 MiB |
| 083f560+dirty | 3.19 MiB | 4.56 MiB | 1.38 MiB |
| c4e097a+dirty | 3.19 MiB | 4.44 MiB | 1.25 MiB |
| df83aad+dirty | 3.41 MiB | 4.57 MiB | 1.16 MiB |
| af9331b+dirty | 3.19 MiB | 4.48 MiB | 1.29 MiB |
| 8d89cc9+dirty | 3.19 MiB | 4.53 MiB | 1.35 MiB |
| 955f2eb+dirty | 3.19 MiB | 4.55 MiB | 1.36 MiB |
| 652f785+dirty | 3.41 MiB | 4.57 MiB | 1.16 MiB |
| 818a608+dirty | 3.19 MiB | 4.48 MiB | 1.29 MiB |
| 136effd+dirty | 3.41 MiB | 4.57 MiB | 1.16 MiB |
Previous results on branch: antonis/fix-replay-capture-during-app-restart
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 28c74e7+dirty | 1217.37 ms | 1214.96 ms | -2.41 ms |
| 145273c+dirty | 1217.34 ms | 1219.49 ms | 2.15 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 28c74e7+dirty | 3.41 MiB | 4.58 MiB | 1.17 MiB |
| 145273c+dirty | 3.41 MiB | 4.58 MiB | 1.17 MiB |
antonis
commented
Nov 19, 2025
Collaborator
|
@sentry review |
Collaborator
|
Overall looking good! I left a few questions in regard to the naming and description of the added boolean flag. |
alwx
approved these changes
Nov 19, 2025
Contributor
alwx
left a comment
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.
I'd say isAppRestarted sounds a bit more natural to me but that's probably a personal thing. Otherwise everything looks fine!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Added an
isFromRunApplicationflag to distinguish between:runApplication) → Preserve interaction spans for replay captureThe interaction span now remains alive during error processing, giving the native SDK time to:
💡 Motivation and Context
Fixes #5074
The issue was originally reported with buttons using the
sentry-labelprop, which enables user interaction tracing. Thesentry-labelitself isn't the cause, but it's necessary for reproduction because it ensures an interaction span is created. Without user interaction tracing enabled, the bug wouldn't manifest the same way.The actual root cause is that ANY interaction span (labeled or not) gets prematurely cancelled when an error triggers an app restart.
💚 How did you test it?
CI, Manual
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps