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: Skip UI crumbs when target or sender is nil #4211

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

philipphofmann
Copy link
Member

📜 Description

Skip adding breadcrumbs when sendAction is called with either target or sender being nil. This fixes an issue with a third-party library calling sendAction with target being nil in a tight loop.

💡 Motivation and Context

Fixes GH-4019

💚 How did you test it?

Unit test.

📝 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

Skip adding breadcrumbs when sendAction is called with either target or
sender being nil. This fixes an issue with a third-party library calling
sendAction with target being nil in a tight loop.

Fixes GH-4019
Copy link

codecov bot commented Jul 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.416%. Comparing base (fe89531) to head (a12b866).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4211       +/-   ##
=============================================
+ Coverage   91.408%   91.416%   +0.008%     
=============================================
  Files          611       611               
  Lines        49024     49035       +11     
  Branches     17702     17688       -14     
=============================================
+ Hits         44812     44826       +14     
+ Misses        4120      4116        -4     
- Partials        92        93        +1     
Files Coverage Δ
Sources/Sentry/SentryBreadcrumbTracker.m 77.181% <100.000%> (+0.990%) ⬆️
...ons/Breadcrumbs/SentryBreadcrumbTrackerTests.swift 93.589% <100.000%> (+0.439%) ⬆️

... and 3 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 fe89531...a12b866. Read the comment docs.

Copy link

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1220.65 ms 1238.78 ms 18.12 ms
Size 21.58 KiB 694.19 KiB 672.60 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d760c3f 1228.58 ms 1246.22 ms 17.64 ms
3f74b8f 1229.90 ms 1249.42 ms 19.52 ms
983de17 1260.57 ms 1263.68 ms 3.11 ms
5d6ce0e 1206.72 ms 1228.67 ms 21.95 ms
bd2afa6 1192.31 ms 1210.37 ms 18.05 ms
1e065bc 1239.69 ms 1258.18 ms 18.49 ms
3478fc5 1237.94 ms 1251.13 ms 13.19 ms
3297d6e 1196.08 ms 1205.43 ms 9.35 ms
5be7a7c 1223.25 ms 1237.12 ms 13.87 ms
a176fc4 1250.29 ms 1257.88 ms 7.59 ms

App size

Revision Plain With Sentry Diff
d760c3f 22.84 KiB 403.17 KiB 380.33 KiB
3f74b8f 21.58 KiB 418.78 KiB 397.20 KiB
983de17 22.84 KiB 403.19 KiB 380.34 KiB
5d6ce0e 22.85 KiB 405.38 KiB 382.53 KiB
bd2afa6 20.76 KiB 420.55 KiB 399.79 KiB
1e065bc 20.76 KiB 425.78 KiB 405.01 KiB
3478fc5 21.58 KiB 654.59 KiB 633.01 KiB
3297d6e 21.58 KiB 418.44 KiB 396.86 KiB
5be7a7c 21.58 KiB 671.89 KiB 650.31 KiB
a176fc4 22.84 KiB 403.24 KiB 380.39 KiB

@philipphofmann philipphofmann merged commit 9f12001 into main Aug 1, 2024
64 of 67 checks passed
@philipphofmann philipphofmann deleted the fix/send-action-target-nil branch August 1, 2024 06:32
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.

Calling sendAction with nil in a tight loop causes performance issue
2 participants