NWPathMonitor fails to report WIFI coming back if cellular is on

Feedback FB7556677


This is my code:


private lazy var  pmC = NWPathMonitor(requiredInterfaceType: .cellular)
private lazy var  pmW = NWPathMonitor(requiredInterfaceType: .wifi)

pmC.pathUpdateHandler = { (path: NWPath) in
    print("C PATH STATUS:", path.status)
    path.availableInterfaces.forEach( { interfce in
        DispatchQueue.main.async {
            print("  C INTERFACE:", interfce, "Status:", path.status)
        }
    } )
}
pmC.start(queue: assetQueue)

pmW.pathUpdateHandler = { (path: NWPath) in
    print("W PATH STATUS:", path.status)
    path.availableInterfaces.forEach( { interfce in
        DispatchQueue.main.async {
            print("  W INTERFACE:", interfce, "Status:", path.status)
        }
    } )
}
pmW.start(queue: assetQueue)


Do a test. Lauch with both cellular and wifi on. Works as expected. Turn WIFI off, works again. Turn WIFI back on - nothing. So as far as I know, I've only got an "expensive network" available, even though WIFI is on and I can use it in Safari.


Console Log:

// WIFI and CELLULAR ON, launch
C PATH STATUS: satisfied
W PATH STATUS: satisfied
   C INTERFACE: pdp_ip0 Status: satisfied
   W INTERFACE: en0 Status: satisfied

// Turn Cell off
C PATH STATUS: unsatisfied

// Turn WIFI off
W PATH STATUS: unsatisfied

// Turn Cell on
C PATH STATUS: satisfied
   C INTERFACE: pdp_ip0 Status: satisfied
C PATH STATUS: satisfied
   C INTERFACE: pdp_ip0 Status: satisfied
C PATH STATUS: satisfied
   C INTERFACE: pdp_ip0 Status: satisfied

// WIFI on
  ... nothing


Even switched to Safari, opened a web page, then switched back. Nothing after many minutes.


Note: iOS 13.3 iPhone 6s+ I tried and tried to get a sysdiagnose - volume buttons and power button for 1+ seconds, nothing happens.

One of my end users is seeing this issue (seen via sysdiagnose logs from that user). It's causing things to break only for that user. Two things I noticed about this user:

  1. It only seems to happen for them connecting to a school network where they have to use their login credentials to gain access to the network. Even after successfully connecting to the school wifi network, the NWPath still has the preferred (first) network as pdp_ip0. In my testing after connecting to WiFi, the preferred network becomes en0.
  2. This user is on AT&T. I don't have a test device with AT&T LTE to test this.

Are either of these true for your case?

NWPathMonitor fails to report WIFI coming back if cellular is on
 
 
Q