-
-
Notifications
You must be signed in to change notification settings - Fork 363
Convert SentryReachability
to Swift
#6019
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6019 +/- ##
=============================================
- Coverage 86.774% 86.671% -0.104%
=============================================
Files 425 427 +2
Lines 36741 36792 +51
Branches 17366 17302 -64
=============================================
+ Hits 31882 31888 +6
- Misses 4814 4858 +44
- Partials 45 46 +1
... and 63 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
ccf1278 | 1226.84 ms | 1248.51 ms | 21.67 ms |
d23a1b1 | 1218.94 ms | 1239.53 ms | 20.60 ms |
1b008ee | 1209.57 ms | 1258.67 ms | 49.10 ms |
c6d2354 | 1226.53 ms | 1252.69 ms | 26.16 ms |
be6a4ee | 1226.33 ms | 1249.77 ms | 23.44 ms |
fac4ca3 | 1222.81 ms | 1235.83 ms | 13.02 ms |
b193842 | 1231.36 ms | 1247.69 ms | 16.33 ms |
2de3f92 | 1207.56 ms | 1234.96 ms | 27.40 ms |
2675d3c | 1218.94 ms | 1239.36 ms | 20.42 ms |
f8029e2 | 1245.16 ms | 1261.32 ms | 16.16 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
ccf1278 | 23.75 KiB | 877.15 KiB | 853.40 KiB |
d23a1b1 | 23.75 KiB | 913.64 KiB | 889.88 KiB |
1b008ee | 23.75 KiB | 929.71 KiB | 905.96 KiB |
c6d2354 | 23.75 KiB | 919.70 KiB | 895.95 KiB |
be6a4ee | 23.75 KiB | 913.14 KiB | 889.39 KiB |
fac4ca3 | 23.75 KiB | 902.01 KiB | 878.27 KiB |
b193842 | 23.75 KiB | 920.65 KiB | 896.90 KiB |
2de3f92 | 23.75 KiB | 919.69 KiB | 895.94 KiB |
2675d3c | 23.75 KiB | 928.16 KiB | 904.41 KiB |
f8029e2 | 23.75 KiB | 893.72 KiB | 869.97 KiB |
Previous results on branch: itay/cocoa-533-convert-sentryreachability-to-swift
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
6806bfa | 1221.80 ms | 1247.77 ms | 25.97 ms |
fb615c0 | 1228.12 ms | 1256.26 ms | 28.13 ms |
4ff1298 | 1213.61 ms | 1241.84 ms | 28.23 ms |
96d41c3 | 1236.33 ms | 1253.82 ms | 17.49 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
6806bfa | 23.75 KiB | 935.87 KiB | 912.13 KiB |
fb615c0 | 23.75 KiB | 935.53 KiB | 911.78 KiB |
4ff1298 | 23.75 KiB | 935.54 KiB | 911.79 KiB |
96d41c3 | 23.75 KiB | 935.54 KiB | 911.79 KiB |
…github.com:getsentry/sentry-cocoa into itay/cocoa-533-convert-sentryreachability-to-swift
…github.com:getsentry/sentry-cocoa into itay/cocoa-533-convert-sentryreachability-to-swift
I remember that change proposal, but while we still support iOS 11, we need to use this reachability since this will be a blocker for the swift conversion project |
We can also consider removing support for iOS 11 for SentryReachability. We only use it for network breadcrumbs and sending envelopes when a device gets online again. The impact of the removed functionality for iOS 11 users is minimal, and the market share is close to 0%. |
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 LGTM, left a couple of comments to discuss.
@philipphofmann I would like us to stick to the plan and convert to Swift as much as possible, instead of rewriting parts of the SDK now.
public func add(_ observer: SentryReachabilityObserver) { | ||
SentrySDKLog.debug("Adding observer: \(observer)") | ||
|
||
objc_sync_enter(reachabilityObservers) |
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.
m
: I am seeing this sync solution for the first time in the repository. Is there an advantage of objc_sync_enter
over other sync methods like locks?
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.
It is the same behavior
} | ||
#endif // DEBUG || SENTRY_TEST || SENTRY_TEST_CI | ||
|
||
let reachabilityQueue = DispatchQueue(label: "io.sentry.cocoa.connectivity") |
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.
m
: We could consider SentryDispatchQueueWrapper
even if it is a 1:1 conversion
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.
NWPathMonitor
requires a queue to start
SentrySDKLog.debug("Started NWPathMonitor") | ||
} else { | ||
// For iOS 11 and earlier, simulate always being connected via WiFi | ||
SentrySDKLog.debug("NWPathMonitor not available. Using fallback: always connected via WiFi") |
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.
m
: This should be a user-visible warning, not only in the debug logs.
SentrySDKLog.debug("NWPathMonitor not available. Using fallback: always connected via WiFi") | |
SentrySDKLog.warn("NWPathMonitor not available. Using fallback: always connected via WiFi") |
@philprime, the conversion wasn't looking so great because the APIs are mostly ObjC low-level. As we want to ditch SentryReachability with |
#skip-changelog