Skip to content
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

fix(perf): Cancel spans in background doesn't crash in environments without AppState #3727

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

krystofwoldrich
Copy link
Member

📢 Type of change

  • Bugfix

📜 Description

Some RN environments do not have App State available, we have to check for it before use. Cancel background spans func was missing this check.

💡 Motivation and Context

💚 How did you test it?

sample app, tests

📝 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

Copy link
Contributor

github-actions bot commented Apr 2, 2024

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 447.30 ms 502.42 ms 55.12 ms
Size 17.73 MiB 19.93 MiB 2.20 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
e2b64fe 316.88 ms 330.23 ms 13.35 ms
3ffcddd 302.92 ms 315.80 ms 12.88 ms
70caa60+dirty 299.00 ms 321.02 ms 22.02 ms
abb7058 370.27 ms 389.58 ms 19.31 ms
80b2ce3 385.02 ms 387.36 ms 2.34 ms
9433f35 347.64 ms 356.22 ms 8.58 ms
0677344 327.74 ms 337.14 ms 9.40 ms
52a8031+dirty 311.55 ms 321.37 ms 9.82 ms
0db0c72 372.12 ms 386.00 ms 13.88 ms
3853f43 329.68 ms 346.32 ms 16.64 ms

App size

Revision Plain With Sentry Diff
e2b64fe 17.73 MiB 19.80 MiB 2.07 MiB
3ffcddd 17.73 MiB 19.75 MiB 2.02 MiB
70caa60+dirty 17.73 MiB 19.75 MiB 2.01 MiB
abb7058 17.73 MiB 19.83 MiB 2.10 MiB
80b2ce3 17.73 MiB 19.75 MiB 2.02 MiB
9433f35 17.73 MiB 19.81 MiB 2.08 MiB
0677344 17.73 MiB 19.81 MiB 2.07 MiB
52a8031+dirty 17.73 MiB 20.04 MiB 2.31 MiB
0db0c72 17.73 MiB 19.75 MiB 2.02 MiB
3853f43 17.73 MiB 19.81 MiB 2.08 MiB

Copy link
Contributor

github-actions bot commented Apr 2, 2024

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1224.65 ms 1231.94 ms 7.29 ms
Size 2.36 MiB 2.92 MiB 570.05 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0db0c72+dirty 1275.02 ms 1285.84 ms 10.82 ms
9433f35+dirty 1246.94 ms 1271.45 ms 24.52 ms
76d1baf+dirty 1244.10 ms 1268.52 ms 24.42 ms
e2b64fe+dirty 1232.22 ms 1255.20 ms 22.98 ms
8900e1a+dirty 1210.27 ms 1218.66 ms 8.39 ms
e73f4ed+dirty 1243.27 ms 1244.52 ms 1.25 ms
3853f43+dirty 1221.82 ms 1242.64 ms 20.82 ms
27ef4ee+dirty 1293.52 ms 1296.08 ms 2.56 ms
d7401ac+dirty 1252.38 ms 1275.04 ms 22.66 ms
22e31b6+dirty 1253.62 ms 1265.96 ms 12.34 ms

App size

Revision Plain With Sentry Diff
0db0c72+dirty 2.36 MiB 2.84 MiB 487.01 KiB
9433f35+dirty 2.36 MiB 2.85 MiB 499.80 KiB
76d1baf+dirty 2.36 MiB 2.82 MiB 469.45 KiB
e2b64fe+dirty 2.36 MiB 2.85 MiB 495.80 KiB
8900e1a+dirty 2.36 MiB 2.83 MiB 479.25 KiB
e73f4ed+dirty 2.36 MiB 2.82 MiB 469.44 KiB
3853f43+dirty 2.36 MiB 2.85 MiB 499.81 KiB
27ef4ee+dirty 2.36 MiB 2.85 MiB 500.03 KiB
d7401ac+dirty 2.36 MiB 2.83 MiB 481.14 KiB
22e31b6+dirty 2.36 MiB 2.87 MiB 520.67 KiB

Copy link
Contributor

github-actions bot commented Apr 2, 2024

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 377.90 ms 399.33 ms 21.44 ms
Size 7.15 MiB 8.21 MiB 1.06 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
5446992+dirty 371.61 ms 390.00 ms 18.39 ms
12427f4+dirty 379.48 ms 400.92 ms 21.44 ms
457e29f+dirty 591.49 ms 612.96 ms 21.47 ms
70caa60+dirty 308.83 ms 393.06 ms 84.23 ms
0677344+dirty 288.40 ms 391.44 ms 103.04 ms
9433f35+dirty 265.50 ms 336.08 ms 70.58 ms
6e8584e+dirty 383.37 ms 400.84 ms 17.47 ms
1d86dd6+dirty 335.76 ms 371.22 ms 35.46 ms
52a8031+dirty 330.72 ms 358.76 ms 28.03 ms
728164b+dirty 335.93 ms 342.94 ms 7.01 ms

App size

Revision Plain With Sentry Diff
5446992+dirty 7.15 MiB 8.12 MiB 999.45 KiB
12427f4+dirty 7.15 MiB 8.12 MiB 997.78 KiB
457e29f+dirty 7.15 MiB 8.10 MiB 981.29 KiB
70caa60+dirty 7.15 MiB 8.03 MiB 901.79 KiB
0677344+dirty 7.15 MiB 8.07 MiB 949.80 KiB
9433f35+dirty 7.15 MiB 8.08 MiB 959.34 KiB
6e8584e+dirty 7.15 MiB 8.13 MiB 1002.18 KiB
1d86dd6+dirty 7.15 MiB 8.13 MiB 1002.18 KiB
52a8031+dirty 7.15 MiB 8.09 MiB 965.95 KiB
728164b+dirty 7.15 MiB 8.12 MiB 997.71 KiB

Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

Nice one, LGTM!

@lucas-zimerman lucas-zimerman merged commit 9d81b37 into main Apr 4, 2024
55 of 57 checks passed
@lucas-zimerman lucas-zimerman deleted the kw-fix-cancel-in-bg-without-app-state branch April 4, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants