-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Send envelopes that cannot be cached to disk #4294
Conversation
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
f4e0299 | 1230.33 ms | 1249.68 ms | 19.35 ms |
2a894d5 | 1202.07 ms | 1227.66 ms | 25.59 ms |
9f0d9e0 | 1206.55 ms | 1219.41 ms | 12.86 ms |
8cf5bca | 1212.35 ms | 1223.90 ms | 11.54 ms |
3a31fc9 | 1237.35 ms | 1249.02 ms | 11.67 ms |
984eb2d | 1220.62 ms | 1235.24 ms | 14.62 ms |
c471221 | 1224.16 ms | 1241.59 ms | 17.43 ms |
156e771 | 1228.06 ms | 1242.64 ms | 14.58 ms |
de033da | 1216.91 ms | 1222.84 ms | 5.92 ms |
f1c36e0 | 1215.18 ms | 1223.62 ms | 8.43 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
f4e0299 | 20.76 KiB | 427.54 KiB | 406.78 KiB |
2a894d5 | 21.58 KiB | 414.57 KiB | 392.99 KiB |
9f0d9e0 | 21.58 KiB | 424.28 KiB | 402.70 KiB |
8cf5bca | 21.58 KiB | 671.30 KiB | 649.72 KiB |
3a31fc9 | 20.76 KiB | 414.45 KiB | 393.69 KiB |
984eb2d | 20.76 KiB | 425.77 KiB | 405.01 KiB |
c471221 | 22.85 KiB | 413.89 KiB | 391.04 KiB |
156e771 | 20.76 KiB | 419.70 KiB | 398.94 KiB |
de033da | 21.58 KiB | 418.15 KiB | 396.57 KiB |
f1c36e0 | 21.58 KiB | 670.40 KiB | 648.81 KiB |
Previous results on branch: feat/send-envelope-on-cache-failure
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
cd07176 | 1219.90 ms | 1240.00 ms | 20.10 ms |
70a2a20 | 1250.63 ms | 1266.24 ms | 15.61 ms |
d8edaa7 | 1231.65 ms | 1257.69 ms | 26.05 ms |
0d82804 | 1227.37 ms | 1252.37 ms | 25.01 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
cd07176 | 21.58 KiB | 706.96 KiB | 685.38 KiB |
70a2a20 | 21.58 KiB | 709.33 KiB | 687.75 KiB |
d8edaa7 | 21.58 KiB | 714.88 KiB | 693.30 KiB |
0d82804 | 21.58 KiB | 714.79 KiB | 693.21 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.
Thanks for doing this. A few suggestions.
🚨 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:
|
…entry/sentry-cocoa into feat/send-envelope-on-cache-failure
🚨 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:
|
🚨 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:
|
🚨 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:
|
🚨 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:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4294 +/- ##
==========================================
Coverage 91.687% 91.688%
==========================================
Files 621 623 +2
Lines 50441 50627 +186
Branches 18177 18325 +148
==========================================
+ Hits 46248 46419 +171
- Misses 4100 4115 +15
Partials 93 93
... and 20 files with indirect coverage changes 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.
Almost there 🥅
# Conflicts: # Sources/Sentry/SentryFileManager.m # Sources/Sentry/include/SentryFileManager.h # Tests/SentryTests/Helper/SentryFileManagerTests.swift
🚨 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:
|
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.
Sorry that I didn't see this earlier. The SentryHttpTransport calls
sentry-cocoa/Sources/Sentry/SentryNSURLRequestBuilder.m
Lines 15 to 18 in 394ad33
return [[SentryNSURLRequest alloc] | |
initEnvelopeRequestWithDsn:dsn | |
andData:[SentrySerialization dataWithEnvelope:envelope] | |
didFailWithError:error]; |
The SentrySerialization dataWithEnvelope
can return nil, but the SentryNSURLRequest expects data not to be nil; see
sentry-cocoa/Sources/Sentry/include/SentryNSURLRequest.h
Lines 13 to 24 in 394ad33
- (_Nullable instancetype)initStoreRequestWithDsn:(SentryDsn *)dsn | |
andData:(NSData *)data | |
didFailWithError:(NSError *_Nullable *_Nullable)error; | |
- (_Nullable instancetype)initEnvelopeRequestWithDsn:(SentryDsn *)dsn | |
andData:(NSData *)data | |
didFailWithError:(NSError *_Nullable *_Nullable)error; | |
- (instancetype)initEnvelopeRequestWithURL:(NSURL *)url | |
andData:(NSData *)data | |
authHeader:(nullable NSString *)authHeader | |
didFailWithError:(NSError *_Nullable *_Nullable)error; |
I think this never was a problem because the SentryHttpTransport never tried to send envelopes that it couldn't serialize. So we definitely need a test to validate what happens in that edge case. Maybe we need to change the logic of SentryNSURLRequestBuilder to not create an SentryNSURLRequest
when it can't serialize the envelope.
…entry/sentry-cocoa into feat/send-envelope-on-cache-failure
🚨 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:
|
@philipphofmann Implemented handling of the case where envelope to data fails. Waiting for CI so we can do a final review/feedback round. |
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.
We only miss tests for SentryNSURLRequestBuilder
, then we can merge this. Thank you @denrase.
🚨 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:
|
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.
Thanks @denrase, it looks good!
Thank you @denrase and thanks @brustolin for approving the PR. |
📜 Description
Try to send envelopes that could not be saved to the disk cache.
💡 Motivation and Context
Relates to getsentry/team-mobile#52
💚 How did you test it?
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.🔮 Next steps
Check thread syncing.