SignalR-Client-Swift icon indicating copy to clipboard operation
SignalR-Client-Swift copied to clipboard

HubConnectionDelegate methods not firing on network disconnect in v0.9.0

Open ZombieMK opened this issue 3 years ago • 1 comments

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.

ZombieMK avatar Aug 05 '22 22:08 ZombieMK

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.

moozzyk avatar Aug 06 '22 06:08 moozzyk

Assuming it has been resolved.

moozzyk avatar Aug 16 '22 06:08 moozzyk