launchdarkly / ios-client-sdk

LaunchDarkly Client-side SDK for iOS (Swift and Obj-C)
https://docs.launchdarkly.com/sdk/client-side/ios
Other
69 stars 84 forks source link

"identify" completion handler not called when using SDK with .streaming streaming mode #211

Closed mmiedlarz closed 4 years ago

mmiedlarz commented 4 years ago

Hey!

I'm integrating the latest version of the SDK (4.5.0) to our project (Xcode 11.4), and I spot one huge problem with the following setup:

// Called somewhere when app started
let key = "MY_MOBILE_KEY" 
var config = LDConfig(mobileKey: key)
config.streamingMode = .streaming
LDClient.shared.startCompleteWhenFlagsReceived(config: config) {
    Log.debug("[ThirdParty] LaunchDarkly initialized")
}

// ... and after user logs in (or polling current user session)
let user = LDUser(key: user.userId,
                                email: user.email)
LDClient.shared.identify(user: user) {
   Log.debug("[LaunchDarkly] User updated")
 }

So, when I set streamingMode to .streaming completion closure from identify method is never called. Also I can't check any features/variations - they all return fallback immediately.

It works fine when I switch streamingMode to .polling.

bwoskow-ld commented 4 years ago

Hi @mmiedlarz ,

Thanks for reaching out. We'd like to request that you reach out to our support team at support@launchdarkly.com for further assistance on this issue. We believe that this issue is more likely to be due to a configuration issue rather than a bug in the SDK.

Some further areas of investigation on your support ticket might include:

  1. Did this issue happen in prior SDK versions before updating to 4.5.0 today?
  2. Does this issue happen when you don't set config.streamingMode at all (and use the default value which is also streaming?
  3. Does this issue happen when you pass user in as the second parameter to `startCompleteWhenFlagsReceived?

We recommend providing as much of that information as possible when filing the support request.