NwPathMonitor's pathUpdateHandler block is called without change.

It seems that sometimes the pathUpdateHandler block is called even though the NWPath data is unchanged. Is this known? Or is there some unexposed change to the NWPath struct?

2023-08-23 14:16:02.149962+0900 NWPath -> status: satisfied, unsatisfiedReason: notAvailable, availableInterfaces: ["(type: wifi, name: en0, kernel index: 11)", "(type: cellular, name: pdp_ip0, kernel index: 3)"], isExpensive: false, isConstrained: false, supportsIPv4: true, supportsIPv6: false, supportsDNS: true, gateways: ["(description: 192.168.0.1:0, interface: nil, txtRecord: nil)"], localEndpoint: nil, remoteEndpoint: nil

2023-08-23 14:19:12.077079+0900 NWPath -> status: satisfied, unsatisfiedReason: notAvailable, availableInterfaces: ["(type: wifi, name: en0, kernel index: 11)", "(type: cellular, name: pdp_ip0, kernel index: 3)"], isExpensive: false, isConstrained: false, supportsIPv4: true, supportsIPv6: false, supportsDNS: true, gateways: ["(description: 192.168.0.1:0, interface: nil, txtRecord: nil)"], localEndpoint: nil, remoteEndpoint: nil

2023-08-23 14:19:16.065005+0900 NWPath -> status: satisfied, unsatisfiedReason: notAvailable, availableInterfaces: ["(type: wifi, name: en0, kernel index: 11)", "(type: cellular, name: pdp_ip0, kernel index: 3)"], isExpensive: false, isConstrained: false, supportsIPv4: true, supportsIPv6: false, supportsDNS: true, gateways: ["(description: 192.168.0.1:0, interface: nil, txtRecord: nil)"], localEndpoint: nil, remoteEndpoint: nil

It seems that sometimes the pathUpdateHandler block is called even though the NWPath data is unchanged

I have not seen this to be the case. In your logs it does look like you're seeing the same thing, but are these logs filtered by interface type?

For example if I just run this at my desk I see:

nwMonitor.pathUpdateHandler = { path in
    print("Path update: \(path.debugDescription)")
}
nwMonitor.start(queue: .main)

With the output of:

Path update: satisfied (Path is satisfied), interface: pdp_ip0[value], ipv4, ipv6
Path update: satisfied (Path is satisfied), interface: pdp_ip0[new_value], ipv4, ipv6
NwPathMonitor's pathUpdateHandler block is called without change.
 
 
Q