SignalR-Client-Swift
SignalR-Client-Swift copied to clipboard
HubConnectionDelegate methods not firing on network disconnect in v0.9.0
Describe the bug After updating the pod from v0.8.0 to v0.9.0, HubConnectionDelegate methods stopped firing on network disconnection in iOS versions 13, 14 and 15 (I don't know about previous version of iOS since my app supports iOS versions 13 and up)
Expected behavior
connectionDidClose and connectionWillReconnect should be called when there is network failure.
Code To Reproduce the Issue Create a sample project, add the pod with version 0.9.0, make a successful connection to the server, run the app in any iPhone simulator and turn of the internet connection.
Here is a snippet of how I create the connection to the server:
private class func createConnection(url: URL) -> HubConnection {
return HubConnectionBuilder(url: url)
.withLogging(minLogLevel: .debug)
.withHttpConnectionOptions(configureHttpOptions: { options in
options.skipNegotiation = true
})
.withPermittedTransportTypes(.webSockets)
.withAutoReconnect()
.build()
}
Additional context Once I rolled back to v0.8.0 the issue was fixed.
Please provide logs collected at the .debug level (i.e. use: .withLogging(minLogLevel: .debug)). This feels similar to #226 except for that reconnect was firing in that case. Unfortunately I was not able to figure out why iOS is not firing the callback.
Assuming it has been resolved.