You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this makes more sense at Coil’s layer vs. OkHttp’s?
One problem I have with guards like this is their data is necessarily incomplete. The only way to know for sure whether an HTTP request will succeed is to attempt it! The network status is stale the moment it returns, and it only knows what’s inside the calling host and not the state of the rest of the network.
I do think there’s utility in things like this at the application layer, where you can tell the user that they’re offline and that they should turn on WiFi or whatever.
Coil monitors networks and shortcircuits requests when no available network. It's on by default so the strategy seems solid.
https://github.com/coil-kt/coil/blob/01d96431ef588c3da08cc7ef4afbd3eb8b50b175/coil-base/src/main/java/coil/network/NetworkObserver.kt
https://github.com/coil-kt/coil/blob/01d96431ef588c3da08cc7ef4afbd3eb8b50b175/coil-base/src/main/java/coil/util/SystemCallbacks.kt
The text was updated successfully, but these errors were encountered: