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

impr: Avoid work when storing invalid envelopes #4337

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

philipphofmann
Copy link
Member

📜 Description

When the SDK tries to store an envelope and the serialization fails, it skips trying to store the envelope and handling the maximum envelope limit.

💡 Motivation and Context

After the issue with corrupted envelope data SDK crashes #4280, we safeguard more edge cases when serializing and deserializing envelopes.

💚 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

When the SDK tries to store an envelope and the serialization fails, it
skips trying to store the envelope and handling the maximum envelope
limit.
Copy link

github-actions bot commented Sep 17, 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/SentryFileManager.m

Copy link

github-actions bot commented Sep 17, 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/SentryFileManager.m

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 96.22642% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.672%. Comparing base (e5a239a) to head (8775d02).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ts/SentryTests/TestUtils/SentryInvalidJSONString.m 86.666% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4337       +/-   ##
=============================================
+ Coverage   91.658%   91.672%   +0.014%     
=============================================
  Files          618       620        +2     
  Lines        50351     50401       +50     
  Branches     18144     18168       +24     
=============================================
+ Hits         46151     46204       +53     
+ Misses        4106      4104        -2     
+ Partials        94        93        -1     
Files with missing lines Coverage Δ
Sources/Sentry/SentryFileManager.m 93.333% <100.000%> (+0.051%) ⬆️
...ts/SentryTests/Helper/SentryFileManagerTests.swift 99.305% <100.000%> (+0.006%) ⬆️
...tryTests/Helper/SentryInvalidJSONStringTests.swift 100.000% <100.000%> (ø)
...s/SentryTests/Helper/SentrySerializationNilTests.m 100.000% <ø> (ø)
.../SentryTests/Helper/SentrySerializationTests.swift 98.604% <100.000%> (+0.097%) ⬆️
...tryTests/Networking/SentryHttpTransportTests.swift 99.702% <100.000%> (ø)
...ts/SentryTests/TestUtils/SentryInvalidJSONString.m 86.666% <86.666%> (ø)

... 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 e5a239a...8775d02. Read the comment docs.

@philipphofmann philipphofmann merged commit e02eb74 into main Sep 17, 2024
64 of 65 checks passed
@philipphofmann philipphofmann deleted the impr/avoid-io-work-for-invalid-envelopes branch September 17, 2024 14:14
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