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

iOS streaming does not refresh on value change #201

Closed Titozzz closed 4 years ago

Titozzz commented 4 years ago

Describe the bug When updating a variation value, the new value does not trigger a refresh.

To reproduce Update a variation value, your event listener does not get triggered I think the issue comes from here: https://github.com/launchdarkly/ios-client-sdk/blob/v4/LaunchDarkly/LaunchDarkly/Service%20Objects/FlagChangeNotifier.swift#L161

Expected behavior Same as on android, value updates should trigger the event listener.

SDK version I'm using react-native sdk 2.0.3 with iOS SDK 4.3.0

Titozzz commented 4 years ago

Meanwhile I know the fix is not good but kindof working, I did this:

return !(oldFeatureFlag.matchesVariation(newFeatureFlag) && oldFeatureFlag.value as? String == newFeatureFlag.value as? String)
torchhound commented 4 years ago

Hi @Titozzz the React Native SDK version 2.0.3 is only compatible with iOS SDK version 4.1.2. The use of 4.3.0 is undefined behavior. Please use the correct version and see if that fixes your issue.

Titozzz commented 4 years ago

@torchhound it does not, I've tried both versions, hence the fix I proposed above..

torchhound commented 4 years ago

@Titozzz thank you for reporting this issue, it looks like this is a bug. We will remediate and release a new version soon. Filed as 58261.

torchhound commented 4 years ago

Hi @Titozzz this bug was just fixed in version 4.3.2. Thanks again for reporting it!

Titozzz commented 4 years ago

Thank you very much.