Skip to content

fix(tracing): Cancel auto tx when app goes to background #3307

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
merged 4 commits into from
Sep 29, 2023

Conversation

krystofwoldrich
Copy link
Member

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This PR adds a hook to auto instrumented transactions from ReactNativeTracing (navigation and ui) which cancels them when the app goes to background.

This aligns the behavior with other SDKs and fixed the issue of unexplainable long transactions due to the app in background and the js thread being paused.

💡 Motivation and Context

#3223
Internal Notion Page with context and decision

💚 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
  • All tests passing
  • No breaking changes

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 383.88 ms 403.02 ms 19.15 ms
Size 17.73 MiB 19.84 MiB 2.10 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d197b5c+dirty 338.94 ms 354.87 ms 15.93 ms
15c80ab+dirty 336.27 ms 350.58 ms 14.31 ms
e5c9b8b 409.02 ms 426.66 ms 17.64 ms
abb7058 370.27 ms 389.58 ms 19.31 ms
0db0c72 372.12 ms 386.00 ms 13.88 ms
d0bf494+dirty 375.37 ms 395.14 ms 19.77 ms
52a8031+dirty 311.55 ms 321.37 ms 9.82 ms
70caa60+dirty 299.00 ms 321.02 ms 22.02 ms
3ffcddd 302.92 ms 315.80 ms 12.88 ms
acadc0f+dirty 373.24 ms 381.51 ms 8.27 ms

App size

Revision Plain With Sentry Diff
d197b5c+dirty 17.73 MiB 20.04 MiB 2.31 MiB
15c80ab+dirty 17.73 MiB 20.04 MiB 2.31 MiB
e5c9b8b 17.73 MiB 19.83 MiB 2.10 MiB
abb7058 17.73 MiB 19.83 MiB 2.10 MiB
0db0c72 17.73 MiB 19.75 MiB 2.02 MiB
d0bf494+dirty 17.73 MiB 19.75 MiB 2.02 MiB
52a8031+dirty 17.73 MiB 20.04 MiB 2.31 MiB
70caa60+dirty 17.73 MiB 19.75 MiB 2.01 MiB
3ffcddd 17.73 MiB 19.75 MiB 2.02 MiB
acadc0f+dirty 17.73 MiB 19.75 MiB 2.01 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1232.57 ms 1243.74 ms 11.17 ms
Size 2.36 MiB 2.87 MiB 520.65 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d197b5c+dirty 1217.61 ms 1242.66 ms 25.05 ms
15c80ab+dirty 1223.74 ms 1228.96 ms 5.22 ms
0db0c72+dirty 1275.02 ms 1285.84 ms 10.82 ms
d0bf494+dirty 1289.40 ms 1298.40 ms 9.00 ms
52a8031+dirty 1280.88 ms 1289.78 ms 8.90 ms
70caa60+dirty 1218.27 ms 1230.30 ms 12.03 ms
e5c9b8b+dirty 1258.57 ms 1267.32 ms 8.75 ms
b1e8712+dirty 1256.02 ms 1265.14 ms 9.12 ms
acadc0f+dirty 1264.38 ms 1290.06 ms 25.68 ms
0677344+dirty 1276.70 ms 1300.07 ms 23.37 ms

App size

Revision Plain With Sentry Diff
d197b5c+dirty 2.36 MiB 2.82 MiB 462.86 KiB
15c80ab+dirty 2.36 MiB 2.83 MiB 474.49 KiB
0db0c72+dirty 2.36 MiB 2.84 MiB 487.01 KiB
d0bf494+dirty 2.36 MiB 2.83 MiB 481.15 KiB
52a8031+dirty 2.36 MiB 2.82 MiB 469.44 KiB
70caa60+dirty 2.36 MiB 2.83 MiB 479.27 KiB
e5c9b8b+dirty 2.36 MiB 2.87 MiB 520.43 KiB
b1e8712+dirty 2.36 MiB 2.84 MiB 488.84 KiB
acadc0f+dirty 2.36 MiB 2.83 MiB 480.37 KiB
0677344+dirty 2.36 MiB 2.85 MiB 496.81 KiB

@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 411.38 ms 472.16 ms 60.78 ms
Size 7.15 MiB 8.10 MiB 981.29 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d197b5c+dirty 258.75 ms 313.61 ms 54.86 ms
15c80ab+dirty 276.38 ms 327.54 ms 51.17 ms
0db0c72+dirty 335.20 ms 351.06 ms 15.86 ms
d0bf494+dirty 253.73 ms 308.23 ms 54.49 ms
52a8031+dirty 330.72 ms 358.76 ms 28.03 ms
70caa60+dirty 308.83 ms 393.06 ms 84.23 ms
e5c9b8b+dirty 335.40 ms 360.06 ms 24.67 ms
b1e8712+dirty 322.55 ms 331.84 ms 9.29 ms
acadc0f+dirty 259.04 ms 304.67 ms 45.63 ms
0677344+dirty 288.40 ms 391.44 ms 103.04 ms

App size

Revision Plain With Sentry Diff
d197b5c+dirty 7.15 MiB 8.09 MiB 962.72 KiB
15c80ab+dirty 7.15 MiB 8.09 MiB 966.13 KiB
0db0c72+dirty 7.15 MiB 8.04 MiB 911.02 KiB
d0bf494+dirty 7.15 MiB 8.04 MiB 910.85 KiB
52a8031+dirty 7.15 MiB 8.09 MiB 965.95 KiB
70caa60+dirty 7.15 MiB 8.03 MiB 901.79 KiB
e5c9b8b+dirty 7.15 MiB 8.10 MiB 980.41 KiB
b1e8712+dirty 7.15 MiB 8.04 MiB 912.27 KiB
acadc0f+dirty 7.15 MiB 8.03 MiB 903.20 KiB
0677344+dirty 7.15 MiB 8.07 MiB 949.80 KiB

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.

2 participants