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: Check if clipPath is empty before removing last element #4649

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

antonis
Copy link
Collaborator

@antonis antonis commented Dec 19, 2024

📜 Description

💡 Motivation and Context

I've noticed the following crash while testing getsentry/sentry-react-native#4328 after upgrading to 8.42.0 that included the clipPaths.removeLast() addition.

Thread 6::  Dispatch queue: io.sentry.default
...
4   libswiftCore.dylib            	       0x1930e5614 RangeReplaceableCollection<>.removeLast() + 548
5   sentryreactnativesample.debug.dylib	       0x10a1d968c closure #1 in closure #1 in SentryViewPhotographer.image(view:options:onComplete:) + 2672 (SentryViewPhotographer.swift:85)

💚 How did you test it?

Manual testing with the React Native Sample app and local code changes:

  1. Open the RN sample app from (1) feat: Add Feedback Form Component  sentry-react-native#4328
  2. Open the feedback form
  3. Verified no crash

📝 Checklist

You have to check all boxes before merging:

  • 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.
  • I updated the wizard 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 Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.631%. Comparing base (0b53d9c) to head (5d3eb3b).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4649       +/-   ##
=============================================
+ Coverage   90.628%   90.631%   +0.002%     
=============================================
  Files          620       620               
  Lines        71078     71075        -3     
  Branches     25913     25906        -7     
=============================================
- Hits         64417     64416        -1     
+ Misses        6564      6561        -3     
- Partials        97        98        +1     
Files with missing lines Coverage Δ
Sources/Swift/Tools/SentryViewPhotographer.swift 87.755% <100.000%> (+0.255%) ⬆️

... and 5 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 0b53d9c...5d3eb3b. Read the comment docs.

Copy link

github-actions bot commented Dec 19, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1234.63 ms 1260.59 ms 25.96 ms
Size 22.30 KiB 760.24 KiB 737.93 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
cd72e5c 1238.96 ms 1256.84 ms 17.88 ms
9d61bea 1243.88 ms 1254.36 ms 10.48 ms
2af280d 1246.22 ms 1253.10 ms 6.88 ms
b6ba04e 1230.48 ms 1253.20 ms 22.72 ms
ddc9b9a 1201.71 ms 1226.70 ms 24.99 ms
6e1452d 1241.69 ms 1253.47 ms 11.78 ms
cd76c54 1223.41 ms 1249.65 ms 26.24 ms
aa45f36 1217.59 ms 1236.86 ms 19.27 ms
a34f08c 1234.08 ms 1246.40 ms 12.31 ms
e5dcbd5 1223.47 ms 1243.90 ms 20.43 ms

App size

Revision Plain With Sentry Diff
cd72e5c 22.85 KiB 414.74 KiB 391.89 KiB
9d61bea 20.76 KiB 436.29 KiB 415.53 KiB
2af280d 20.76 KiB 435.22 KiB 414.46 KiB
b6ba04e 20.76 KiB 414.44 KiB 393.68 KiB
ddc9b9a 20.76 KiB 420.40 KiB 399.65 KiB
6e1452d 21.58 KiB 419.68 KiB 398.10 KiB
cd76c54 21.58 KiB 675.85 KiB 654.27 KiB
aa45f36 21.58 KiB 616.73 KiB 595.15 KiB
a34f08c 22.30 KiB 730.30 KiB 708.00 KiB
e5dcbd5 22.85 KiB 414.09 KiB 391.24 KiB

Previous results on branch: antonis/SentryViewPhotographer-ClipEndCheck

Startup times

Revision Plain With Sentry Diff
fb54695 1236.29 ms 1250.82 ms 14.52 ms

App size

Revision Plain With Sentry Diff
fb54695 22.30 KiB 760.24 KiB 737.94 KiB

CHANGELOG.md Show resolved Hide resolved
@antonis antonis marked this pull request as ready for review December 19, 2024 11:44
Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

Thanks @antonis
I have this on an ongoing PR, but I dont see why not merge this already.

@antonis
Copy link
Collaborator Author

antonis commented Dec 19, 2024

Thank you for the quick review @brustolin 🙇

@antonis antonis merged commit e304199 into main Dec 19, 2024
72 checks passed
@antonis antonis deleted the antonis/SentryViewPhotographer-ClipEndCheck branch December 19, 2024 12:45
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