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: Use UInts in envelope deserialization #4441

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

philipphofmann
Copy link
Member

📜 Description

Use unsigned integers for the indexes for accessing envelope data to eliminate the risk of negative indices.

💡 Motivation and Context

Brought up as a nitpick by one of our customers, and it makes sense.

💚 How did you test it?

CI still green.

📝 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

Use unsigned integers for the indexes for accessing envelope data to
eliminate the risk of negative indices.
Copy link

github-actions bot commented Oct 15, 2024

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentrySerialization.m

Copy link

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1241.29 ms 1264.02 ms 22.73 ms
Size 21.58 KiB 707.22 KiB 685.64 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4bad5f9 1237.20 ms 1250.51 ms 13.31 ms
728804f 1235.26 ms 1254.20 ms 18.94 ms
861d361 1227.90 ms 1231.45 ms 3.55 ms
add8416 1270.72 ms 1300.38 ms 29.66 ms
af1f4dd 1225.39 ms 1245.48 ms 20.09 ms
ed49f0c 1245.67 ms 1261.15 ms 15.48 ms
7bc3c0d 1259.74 ms 1268.45 ms 8.71 ms
02a972c 1207.08 ms 1221.78 ms 14.70 ms
c59914b 1342.08 ms 1375.73 ms 33.65 ms
6943de0 1235.98 ms 1246.88 ms 10.90 ms

App size

Revision Plain With Sentry Diff
4bad5f9 21.58 KiB 678.20 KiB 656.61 KiB
728804f 22.85 KiB 411.76 KiB 388.91 KiB
861d361 20.76 KiB 435.65 KiB 414.89 KiB
add8416 21.58 KiB 541.91 KiB 520.33 KiB
af1f4dd 22.85 KiB 414.71 KiB 391.86 KiB
ed49f0c 21.58 KiB 632.13 KiB 610.55 KiB
7bc3c0d 20.76 KiB 427.35 KiB 406.59 KiB
02a972c 22.85 KiB 413.42 KiB 390.57 KiB
c59914b 21.58 KiB 671.90 KiB 650.32 KiB
6943de0 20.76 KiB 393.33 KiB 372.57 KiB

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.345%. Comparing base (f273312) to head (49498c8).
Report is 8 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4441       +/-   ##
=============================================
+ Coverage   91.333%   91.345%   +0.011%     
=============================================
  Files          610       610               
  Lines        49927     49926        -1     
  Branches     18033     18042        +9     
=============================================
+ Hits         45600     45605        +5     
+ Misses        4235      4229        -6     
  Partials        92        92               
Files with missing lines Coverage Δ
Sources/Sentry/SentrySerialization.m 98.360% <100.000%> (ø)

... 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 f273312...49498c8. Read the comment docs.

@philipphofmann philipphofmann merged commit f31b069 into main Oct 15, 2024
63 of 65 checks passed
@philipphofmann philipphofmann deleted the impr/use-unsigned-ints-envelope-with-data branch October 15, 2024 14:31
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