-
-
Notifications
You must be signed in to change notification settings - Fork 366
fix: Add null-handling for parsed DSN in SentryHTTPTransport #5800
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5800 +/- ##
========================================
Coverage ? 86.674%
========================================
Files ? 423
Lines ? 36547
Branches ? 17288
========================================
Hits ? 31677
Misses ? 4825
Partials ? 45
Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit unsure about the approach. I think it changes the logic.
…eports properties - Changed the initialization method to accept SentryDsn and sendClientReports instead of SentryOptions. - Updated related methods to use the new properties for client report handling. - Adjusted tests to reflect the new initialization parameters and ensure proper functionality.
cursor review |
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d38165b | 1211.41 ms | 1242.49 ms | 31.08 ms |
4bf98bf | 1219.13 ms | 1244.50 ms | 25.38 ms |
8047b99 | 1226.37 ms | 1246.63 ms | 20.26 ms |
7416ffc | 1225.55 ms | 1241.80 ms | 16.25 ms |
7f2f69c | 1237.61 ms | 1266.96 ms | 29.35 ms |
ad964ca | 1234.73 ms | 1254.88 ms | 20.15 ms |
07d7e83 | 1211.71 ms | 1240.08 ms | 28.37 ms |
db9572a | 1200.27 ms | 1234.80 ms | 34.53 ms |
2a7868a | 1226.54 ms | 1256.92 ms | 30.37 ms |
605fa27 | 1226.31 ms | 1251.35 ms | 25.05 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d38165b | 23.75 KiB | 855.37 KiB | 831.62 KiB |
4bf98bf | 23.75 KiB | 919.70 KiB | 895.95 KiB |
8047b99 | 23.75 KiB | 855.37 KiB | 831.62 KiB |
7416ffc | 23.75 KiB | 913.63 KiB | 889.88 KiB |
7f2f69c | 23.75 KiB | 913.38 KiB | 889.63 KiB |
ad964ca | 23.75 KiB | 913.17 KiB | 889.42 KiB |
07d7e83 | 23.75 KiB | 913.27 KiB | 889.52 KiB |
db9572a | 23.75 KiB | 858.69 KiB | 834.93 KiB |
2a7868a | 23.75 KiB | 880.20 KiB | 856.45 KiB |
605fa27 | 23.75 KiB | 908.03 KiB | 884.28 KiB |
Previous results on branch: philprime/strict-nullability-10
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
1cc2a9e | 1229.33 ms | 1249.19 ms | 19.86 ms |
388f479 | 1212.06 ms | 1242.74 ms | 30.68 ms |
5091f7c | 1224.33 ms | 1245.30 ms | 20.96 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
1cc2a9e | 23.75 KiB | 920.20 KiB | 896.46 KiB |
388f479 | 23.75 KiB | 913.70 KiB | 889.95 KiB |
5091f7c | 23.75 KiB | 920.20 KiB | 896.46 KiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with a comment on the log message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reposting because Cursor Bot marks comments as outdated: @philipphofmann do you think this is valid feedback?
|
Yes, this is valid feedback. If you previously had sentry-cocoa/Sources/Sentry/SentryClient.m Lines 923 to 926 in ed85746
We could add a cleanup call to the file manager or anywhere else that deletes envelopes in the fallback folder when the DSN is nil, but it's also some overhead for everybody checking if the folder exists and has files. What would you suggest. |
But isn't that what you wanted me to change in this PR comment when you gave the first round of feedback? |
We can keep this. We have a safeguard that I forgot about here sentry-cocoa/Sources/Sentry/SentryClient.m Lines 166 to 168 in 32584c4
I thought that we had the safeguard in the transport, but it's in the client. Sorry my bad. Before this PR, when you didn't set a DSN, the client should not have stored any envelopes to disk via the transport. I thought that when we remove the transport, we stop cleaning up old envelopes at some point when not setting a DSN, because I thought the logic was in the transport. But it's in the client so all good. The logic stays the same. |
Alright in that case I'll merge it as-is. |
We merged #5800 after releasing 8.55.0. We need to move it up to the unreleased section.
We merged #5800 after releasing 8.55.0. We need to move it up to the unreleased section.
This PR is derived from #5572 in an effort to make the large amount of changes easier to review for #5577.
Adds null-handling for the
SentryOptions#parsedDsn
used in the SentryHTTPTransport.This should actually be considered an invalid SDK state, therefore I added fatal logs.
Open for discussion if deleting the envelope and sending the next one is too drastic.