Problem
Production traces show serial Ping+ReconnectApp storms (up to 23 ReconnectApp calls in 52 seconds in one session) where nothing about the network changed. NetworkState fires reconnectApp() from raw NetInfo null→true transitions manufactured by boot's undefined→null→true sequence slipping past guards, NetInfo.refresh() re-emitting cached state, and the SHOULD_USE_STAGING_SERVER Onyx callback rebuilding the NetInfo subscription on every write.
Solution
The recovery branch now fires only when getIsOffline() is true at the moment reachability is confirmed, or when a one-shot pendingReachabilityRecovery token was armed by debug paths (setForceOffline, setFailAllRequests, simulatePoorConnection). The staging-server callback rebuilds the NetInfo subscription only when the effective reachability URL changed, avoiding unnecessary teardown and extra Pings. Regression tests pin that bare null→true transitions never fire reconnect while real offline recovery still works.
PR
#96504
Issue Owner
Current Issue Owner: @mkhutornyi
Problem
Production traces show serial Ping+ReconnectApp storms (up to 23 ReconnectApp calls in 52 seconds in one session) where nothing about the network changed.
NetworkStatefiresreconnectApp()from raw NetInfonull→truetransitions manufactured by boot'sundefined→null→truesequence slipping past guards,NetInfo.refresh()re-emitting cached state, and theSHOULD_USE_STAGING_SERVEROnyx callback rebuilding the NetInfo subscription on every write.Solution
The recovery branch now fires only when
getIsOffline()is true at the moment reachability is confirmed, or when a one-shotpendingReachabilityRecoverytoken was armed by debug paths (setForceOffline,setFailAllRequests,simulatePoorConnection). The staging-server callback rebuilds the NetInfo subscription only when the effective reachability URL changed, avoiding unnecessary teardown and extra Pings. Regression tests pin that barenull→truetransitions never fire reconnect while real offline recovery still works.PR
#96504
Issue Owner
Current Issue Owner: @mkhutornyi