-
Notifications
You must be signed in to change notification settings - Fork 24
feat: new reachability for multibackend - WPB-20050 #3543
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: develop
Are you sure you want to change the base?
Conversation
Test Results3 498 tests 3 471 ✅ 3m 50s ⏱️ Results for commit ed38504. ♻️ This comment has been updated with latest results. |
WireNetwork/Sources/WireNetwork/Network/NetworkStack/NetworkReachability.swift
Outdated
Show resolved
Hide resolved
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.
Nice. I'm pro moving to NWPathMonitor!
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.
@johnxnguyen I believe there might be other cases besides the internet banner:
- Looking at
reachability.mayBeReachable
in the code, we also used reachability to reopen the websocket. i believe we don't at the moment -> but that could go under -> https://wearezeta.atlassian.net/browse/WPB-19904 - ZMTransportRequestScheduler seems to change of status if we're offline
self.isNetworkReachableCancellable = networkReachability.isReachablePublisher | ||
.sink { [weak self] isReachable in | ||
isReachable ? self?.didReceiveData() : self?.didGoOffline() | ||
} |
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.
question: do we need to shutdown ReachabilityWrapper if multibackend is on?
I'm not sure actually this PR is necessary for the initial release: the old ZMReachability should still work for individual accounts because there are separate instances configured with the selected backend. I'll leave this PR open to finish later. |
Issue
This PR introduces a new
NetworkReachability
that makes use ofNWPathMonitor
to report whether the app has an internet connection. This is in contrast to the oldZMReachability
which is written in Objective C, uses a lower level C style network API, and checks reachability of specific hosts.A key difference between the two is that although
NetworkReachability
is much simpler, it only tells us if there is a connection available and not whether a connection to the Wire backends is available. However, I observed that we only use the existing reachability to hide and show the "no internet" banner, so I think this is fine. If we want to check host reachability, we could extend the code to also send pings to specific hosts.Testing
Checklist
[WPB-XXX]
.UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: