Skip to content

startCompleteWhenFlagsReceived completion handler is never invoked when there are network connectivity issues #209

Description

@robmaceachern

Describe the bug
The completion handler of startCompleteWhenFlagsReceived is never invoked if there are network connectivity issues that cause the underlying network requests to fail.

This may also be an issue with the completion handler for identify but I haven't confirmed that case.

To reproduce

  • Use LaunchDarkly 4.4.1 in a Swift project
  • Invoke startCompleteWhenFlagsReceived in the project code
  • On an iOS device, enable Network Link Conditioner and set it to 100% Loss
  • Run the project on the device
LDClient.shared.startCompleteWhenFlagsReceived(config: LDConfig(mobileKey: "a-valid-key")) {
    NSLog("LDClient startCompleteWhenFlagsReceived completed")
}

Expected behavior
The startCompleteWhenFlagsReceived completion handler should be invoked after some timeout period. The log message should be printed eventually.

Logs
The console logs show the underlying requests are timing out but the completion handler isn't invoked at any point while network connectivity is down.

SDK version
4.4.1

Language version, developer tools
Xcode 11, Swift 5

OS/platform
iOS 13.3

Additional context
The documentation states:

// If you need feature flags to load before continuing use the
// startCompleteWhenFlagsReceived method with a completion

However it's currently dangerous to block user progress using this method since it will never time out in the case of network connectivity issues or if the launch darkly web service was failing to respond.

A client-configurable timeout value would be very useful for these situations. It may also make sense to provide some kind of success/status flag in the completion handler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions