launchdarkly / ios-client-sdk

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

Unknown feature flag #346

Closed dkopicSO closed 4 months ago

dkopicSO commented 4 months ago

Hi, from version 9.4.0 flags for secondary clients stopped working and are reported as unknown:

Unknown feature flag; returning default value

Note that flags for main client still work as expected.

I was able to pinpoint that this started happening from this specific commit.

Basic setup looks like this:

var config = LDConfig(mobileKey: self.primaryKey, autoEnvAttributes: .disabled)
try? config.setSecondaryMobileKeys(self.secondaryMobileKeys)
private func getClient(for project: LDProject) -> LDClient? {
        switch project {
        case .core:
            return LDClient.get()
        default:
            return LDClient.get(environment: project.rawValue)
        }
    }
guard let self = self, let client = self.getClient(for: project) else {
                        return fallbackValue
                    }
                    switch fallbackValue {
                    case .array,
                         .null,
                         .object:
                        return client.jsonVariation(forKey: flag, defaultValue: fallbackValue).convertToAny()
                    case .bool(let value):
                        return client.boolVariation(forKey: flag, defaultValue: value)
                    case .number(let value):
                        return client.doubleVariation(forKey: flag, defaultValue: value)
                    case .string(let value):
                        return client.stringVariation(forKey: flag, defaultValue: value)
                    }

LD-log.txt

Library version 9.4.0

XCode and Swift version Xcode 15.0.1, Swift 5.2.

Platform the issue occurs on iOS 17.x.x

keelerm84 commented 4 months ago

Thank you for reporting this issue, and my apologies for the issues this is causing. We will look into this and update you as soon as we have a fix in place.

keelerm84 commented 4 months ago

This should be fixed in v9.4.1. Thank you again for your report and once again, sorry for the inconvenience!

dkopicSO commented 4 months ago

Great, thanks for the quick response :)