-
Notifications
You must be signed in to change notification settings - Fork 93
Description
Describe the bug
When the SDK lost the network connection, the observers registered with observeCurrentConnectionMode are not called.
client.connectionInformation has currentConnectionMode set to streaming. when the network connection is lost or any SynchronizingError except unauthorized one happens, the SDK detects the issue, update LDClient.connectionInformation.lastConnectionFailureReason, but never informs the observers registered with observeCurrentConnectionMode
It's due to ConnectionInformation.synchronizingErrorCheck that updates connectionInformation but doesn't change currentConnectionMode. The switch of currentConnectionMode is needed to trigger the call to the observers. For some SynchronizingError (maybe all), currentConnectionMode should be set to offline until the connection is back. Or it can be set to establishingStreamingConnection, if the error is temporary.
To reproduce
- Start and wait the client
connectionInformationto havecurrentConnectionMode == streaming - Stop the network of your device
observeCurrentConnectionModenot called
Expected behavior
Observer of observeCurrentConnectionMode called with the mode offline or establishingStreamingConnection
Logs
Library version
Reproduced with the version 9.8.2.
XCode and Swift version
XCode 15.4 Swift 5
Platform the issue occurs on
Found on iPhone but likely to be all other platform too( iPad, macOS, tvOS, or watchOS)