Describe the bug
The identify method of LDClient never invokes its completion block parameter in situations of poor connectivity that cause the underlying network requests to fail
To reproduce
- Add LaunchDarkly 5.4.5 to a new project
- Use the
LDClient.identify method and provide a completion block
- Simulate 100% loss of network connection
- Run the project
let user = LDUser(key: "1")
LDClient.get().identify(user) {
print("Call me maybe")
}
Expected behavior
The identify method should call its completion handler after a specified timeout and cause the print to be executed.
Logs
- The console shows the underlying requests failing and the LDClient trying to reconnect infinitely
- The text from the print statement is never logged
SDK version
5.4.5
Language version, developer tools
Xcode 13, Swift 5
OS/platform
iOS 15
Additional context
The LDClient documentation states:
A completion may be passed to the identify method to allow a client app to know when fresh flag values for the new user are ready.
and
completion: Closure called when the embedded setOnlineIdentify call completes, subject to throttling delays. (Optional)
This makes it dangerous to block user progression in the application using the identify method since it will never timeout in the case of network connectivity issues or issues with the Launch Darkly service.
- Adding a
timeout parameter to the identify method to would help mitigate this issue
- Adding additional context to the
completion handler such as a boolean flag indicating whether the completion handler is being invoked in the scenario of success or failure would be very useful for error handling as well
Related issues: #211, #209
Thank you 🙏
Describe the bug
The
identifymethod ofLDClientnever invokes itscompletionblock parameter in situations of poor connectivity that cause the underlying network requests to failTo reproduce
LDClient.identifymethod and provide acompletionblockExpected behavior
The
identifymethod should call itscompletionhandler after a specified timeout and cause theprintto be executed.Logs
SDK version
5.4.5
Language version, developer tools
Xcode 13, Swift 5
OS/platform
iOS 15
Additional context
The LDClient documentation states:
and
This makes it dangerous to block user progression in the application using the
identifymethod since it will never timeout in the case of network connectivity issues or issues with the Launch Darkly service.timeoutparameter to theidentifymethod to would help mitigate this issuecompletionhandler such as a boolean flag indicating whether thecompletionhandler is being invoked in the scenario of success or failure would be very useful for error handling as wellRelated issues: #211, #209
Thank you 🙏