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: Session replay for crash not created because of a race condition #4314

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

brustolin
Copy link
Contributor

📜 Description

This fix an issue where the SR is not sent for crashes that mostly happens in RN.

💚 How did you test it?

Unit tests

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 88.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.622%. Comparing base (e1c3819) to head (0e8277d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
Sources/Sentry/SentrySessionReplayIntegration.m 82.352% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4314       +/-   ##
=============================================
- Coverage   91.649%   91.622%   -0.028%     
=============================================
  Files          618       617        -1     
  Lines        50251     50180       -71     
  Branches     18145     18062       -83     
=============================================
- Hits         46055     45976       -79     
- Misses        4103      4112        +9     
+ Partials        93        92        -1     
Files with missing lines Coverage Δ
...onReplay/SentrySessionReplayIntegrationTests.swift 98.623% <100.000%> (+0.025%) ⬆️
Sources/Sentry/SentrySessionReplayIntegration.m 84.937% <82.352%> (-0.461%) ⬇️

... and 17 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1c3819...0e8277d. Read the comment docs.

Copy link

github-actions bot commented Sep 5, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1228.04 ms 1245.59 ms 17.55 ms
Size 21.58 KiB 708.82 KiB 687.24 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b9b0f0a 1251.45 ms 1257.86 ms 6.41 ms
11b2ffa 1204.86 ms 1218.16 ms 13.31 ms
973d574 1237.35 ms 1256.15 ms 18.80 ms
e89dc54 1220.57 ms 1233.45 ms 12.88 ms
6e1452d 1241.69 ms 1253.47 ms 11.78 ms
cd76c54 1223.41 ms 1249.65 ms 26.24 ms
92bc771 1236.60 ms 1245.67 ms 9.07 ms
8d16504 1235.50 ms 1258.76 ms 23.26 ms
533c68f 1236.54 ms 1256.68 ms 20.14 ms
1731a1c 1237.33 ms 1255.45 ms 18.12 ms

App size

Revision Plain With Sentry Diff
b9b0f0a 20.76 KiB 434.94 KiB 414.18 KiB
11b2ffa 22.85 KiB 412.67 KiB 389.82 KiB
973d574 21.58 KiB 542.39 KiB 520.81 KiB
e89dc54 22.85 KiB 412.60 KiB 389.75 KiB
6e1452d 21.58 KiB 419.68 KiB 398.10 KiB
cd76c54 21.58 KiB 675.85 KiB 654.27 KiB
92bc771 21.58 KiB 699.30 KiB 677.72 KiB
8d16504 20.76 KiB 434.92 KiB 414.16 KiB
533c68f 21.58 KiB 630.28 KiB 608.70 KiB
1731a1c 21.58 KiB 542.28 KiB 520.69 KiB

Previous results on branch: fix/last-session-replay

Startup times

Revision Plain With Sentry Diff
852663f 1235.88 ms 1247.77 ms 11.89 ms

App size

Revision Plain With Sentry Diff
852663f 21.58 KiB 707.90 KiB 686.32 KiB

Copy link
Member

@krystofwoldrich krystofwoldrich left a comment

Choose a reason for hiding this comment

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

I don't see why the new replay was started before the previous was processed.

But the fix looks good. 👍

Copy link
Member

@armcknight armcknight left a comment

Choose a reason for hiding this comment

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

Looks fine. I would prefer to see SentryFileManager instead of naked NSFileManager usages. Even if we don't use an instance of SentryFileManager, we should be breaking out the logic into static functions so we can reuse what we've already built, instead of always rewriting the same error handling.

@brustolin brustolin merged commit 7f720fb into main Sep 13, 2024
62 of 65 checks passed
@brustolin brustolin deleted the fix/last-session-replay branch September 13, 2024 14:02
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.

3 participants