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
{{ message }}
Repository navigation
bug(network): iOS getStatus() returns the last reachability callback value instead of reading current flags #2620
Flags are only read synchronously when they're nil (first call, or the initial check in startNotifier). After that, flags is only updated by the reachability callback, so getStatus() answers with the state as of the last callback. Called right after a network change, before that callback has landed on the reachability queue, it returns the previous state.
Expected Behavior
getStatus() reads the current flags when it is called.
Code Reproduction
No sample app needed beyond the plugin's own example:
Turn Wi-Fi off in Control Center (with cellular off or available).
Immediately call await Network.getStatus() (e.g. from a button, or in a tight loop logging every few ms) and compare it to the next networkStatusChange event. Until the event arrives, getStatus() keeps returning the previous connectionType/connected, because nothing re-reads the flags.
Other Technical Details
This is only about getStatus() freshness. A PR follows that re-reads the flags synchronously in getStatus() and keeps the existing SCNetworkReachability implementation.
Older reports with related symptoms, closed during backlog cleanup without a fix: #40 (one commenter there notes getStatus() being out of sync with the actual state).
Activity