Skip to content

Conversation

@antonis
Copy link
Contributor

@antonis antonis commented Nov 19, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Added an isFromRunApplication flag to distinguish between:

  • Normal navigation (user taps navigation button) → Cancel interaction spans as before
  • App restart (error-triggered via runApplication) → Preserve interaction spans for replay capture

The interaction span now remains alive during error processing, giving the native SDK time to:

  • Capture the replay
  • Associate it with the error event
  • Access the full span context

💡 Motivation and Context

Fixes #5074

The issue was originally reported with buttons using the sentry-label prop, which enables user interaction tracing. The sentry-label itself 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

  • 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.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 370.63 ms 398.38 ms 27.75 ms
Size 43.94 MiB 48.85 MiB 4.91 MiB

Baseline results on branch: main

Startup times

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 405.09 ms 413.06 ms 7.97 ms
Size 43.75 MiB 48.02 MiB 4.27 MiB

Baseline results on branch: main

Startup times

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1201.77 ms 1210.09 ms 8.32 ms
Size 3.41 MiB 4.58 MiB 1.17 MiB

Baseline results on branch: main

Startup times

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1215.89 ms 1235.17 ms 19.28 ms
Size 3.41 MiB 4.58 MiB 1.17 MiB

Baseline results on branch: main

Startup times

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 antonis marked this pull request as ready for review November 19, 2025 12:02
@lucas-zimerman
Copy link
Collaborator

@sentry review

@lucas-zimerman
Copy link
Collaborator

Overall looking good! I left a few questions in regard to the naming and description of the added boolean flag.

Copy link
Contributor

@alwx alwx left a 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!

@antonis antonis merged commit 7e9c42c into main Nov 20, 2025
75 checks passed
@antonis antonis deleted the antonis/fix-replay-capture-during-app-restart branch November 20, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to get replay session when integrating both reactNavigationIntegration() & mobileReplayIntegration()

4 participants