Closed abuicke closed 9 months ago
Should I re-enable emitting a default value when InternetStateObservableImpl
is initialized?
init {
applicationScope.launch {
// Starting off with a default value of no connection
sharedFlow.emit(NetworkState.NO_CONNECTION)
..........
If the Wi-Fi and the Mobile Data are connected at the same time, and the Wi-Fi gets shut off, it can take quite a while for the Mobile Data connection to be determined to have internet availability (15+ seconds)
So it can be tested with networks that are available but don't reach the internet. What happens? How long should the timeout be? Several times the timeout was not long enough to switch connections and establish it was connected. Is the
isOnline()
check even necessary? It seems like Android actually handles that, but I'm not sure.