launchdarkly / android-client-sdk

LaunchDarkly Client-side SDK for Android
Other
45 stars 23 forks source link

If appVersion is added as a custom attribute, when app upgrades but is relaunched while offline, unknown feature flag error happens #170

Closed anawu2006 closed 2 years ago

anawu2006 commented 2 years ago

Is this a support request? No.

Describe the bug In our Android app, we add appVersion as a custom attribute of LDUser, and apparently this data is being used as part of the flag store id. Because of this, each time when app upgrades, a new flag store is created. If app upgrades but is relaunched while offline, since a new flag store is being used and there is no flags in it yet, unknown feature flag error will happen when getting flag values.

To reproduce

  1. add appVersion as a custom attribute of LDUser;
  2. launch the app and have all feature flags synced from cloud;
  3. upgrade app to a new version;
  4. put device to offline;
  5. relaunch app.

Expected behavior Same flag store is being used after app version changed.

SDK version Android SDK 3.1.1

Language version, developer tools Android Kotlin

OS/platform Android API 31

Additional context I am not sure if this is a bug or a feature. But is there any way I can have appVersion without affecting the flag store identifier?

maxkohne commented 2 years ago

We ran into the same thing and reported it here in this issue. https://github.com/launchdarkly/android-client-sdk/issues/150

anawu2006 commented 2 years ago

We ran into the same thing and reported it here in this issue. #150

ah, thank you so much for pointing this out! I will just close this one and follow the status in #150. Seems the fix won't be ready any time soon though.