sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

feat: Validate single occurence of Sentry SDK inbinaries

Open itaybre opened this issue 6 months ago • 3 comments

:scroll: Description

Add a log message when Sentry SDK is found to be present twice + Added a breakpoint

:bulb: Motivation and Context

Fixes #4566

:green_heart: How did you test it?

Running duplicated SDK app + Unit Tests cases

:pencil: 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.

TODO:

  • [ ] See how to tests this without needing to capture app output
  • [ ] Define how we want to raise this error

itaybre avatar May 26 '25 21:05 itaybre

Messages
:book: Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by :no_entry_sign: dangerJS against 62a78351ab1d5918deb8df63860451cd5dd5a852

github-actions[bot] avatar May 26 '25 21:05 github-actions[bot]

Codecov Report

Attention: Patch coverage is 98.63014% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.463%. Comparing base (94a6b1a) to head (62a7835). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
Sources/Swift/Tools/LoadValidator.swift 98.412% 1 Missing :warning:
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #5298       +/-   ##
=============================================
- Coverage   86.671%   86.463%   -0.209%     
=============================================
  Files          419       419               
  Lines        35864     35769       -95     
  Branches     16923     15175     -1748     
=============================================
- Hits         31084     30927      -157     
- Misses        4498      4802      +304     
+ Partials       282        40      -242     
Files with missing lines Coverage Δ
Sources/Sentry/SentryBinaryImageCache.m 100.000% <100.000%> (ø)
Sources/Sentry/SentrySDK.m 88.028% <100.000%> (ø)
Sources/Swift/Tools/LoadValidator.swift 98.412% <98.412%> (ø)

... and 58 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 94a6b1a...62a7835. Read the comment docs.

codecov[bot] avatar May 26 '25 21:05 codecov[bot]

I believe we should update the PR branch before continuing review

philprime avatar Jun 23 '25 07:06 philprime

Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 1236.85 ms 1256.79 ms 19.94 ms
Size 23.75 KiB 904.53 KiB 880.78 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
d7461dcce354e5fa9ed0555603d90586931e4ac0 1233.69 ms 1255.29 ms 21.60 ms
4e3915a1435ed4a4d9d0035b403ec9e49a415dae 1230.02 ms 1258.90 ms 28.88 ms
5258fb863d08be1cbd0f28d407adbea274ce1c98 1207.92 ms 1234.51 ms 26.59 ms
cc7f62909790ae46c8d72f3c9857ce5349f59b10 1226.00 ms 1245.51 ms 19.51 ms
a9fac2ee07f3f3fdfcfaa629a365dc234afa7678 1212.45 ms 1219.67 ms 7.22 ms
0529194e06f7f3649a1a1858507ee90e7a887621 1237.23 ms 1254.67 ms 17.44 ms
30f4e4c5057d3ad525bd42ce9e4e583f293e9d12 1213.21 ms 1250.29 ms 37.08 ms
354b020de9539094520f92092dcce6cf5be141ec 1223.88 ms 1236.82 ms 12.94 ms
ae7be93a3f06b33d2bffe1b7f9de8cef30e5102e 1236.24 ms 1258.18 ms 21.94 ms
62799929787f2fedf64bbf922cda9e40ff7232b1 1213.60 ms 1241.38 ms 27.79 ms

App size

Revision Plain With Sentry Diff
d7461dcce354e5fa9ed0555603d90586931e4ac0 23.75 KiB 874.45 KiB 850.70 KiB
4e3915a1435ed4a4d9d0035b403ec9e49a415dae 23.75 KiB 858.69 KiB 834.94 KiB
5258fb863d08be1cbd0f28d407adbea274ce1c98 23.75 KiB 874.45 KiB 850.70 KiB
cc7f62909790ae46c8d72f3c9857ce5349f59b10 23.75 KiB 878.48 KiB 854.73 KiB
a9fac2ee07f3f3fdfcfaa629a365dc234afa7678 23.75 KiB 879.53 KiB 855.78 KiB
0529194e06f7f3649a1a1858507ee90e7a887621 23.74 KiB 891.02 KiB 867.28 KiB
30f4e4c5057d3ad525bd42ce9e4e583f293e9d12 23.75 KiB 879.24 KiB 855.50 KiB
354b020de9539094520f92092dcce6cf5be141ec 23.75 KiB 878.19 KiB 854.44 KiB
ae7be93a3f06b33d2bffe1b7f9de8cef30e5102e 23.75 KiB 879.24 KiB 855.49 KiB
62799929787f2fedf64bbf922cda9e40ff7232b1 23.75 KiB 891.03 KiB 867.28 KiB

github-actions[bot] avatar Jul 22 '25 17:07 github-actions[bot]