Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Android: registerAllFlagsListener is passing a stringified array instead of an array of strings to the given callback #89

@rodperottoni

Description

@rodperottoni

Is this a support request?
No.

Describe the bug
On Android, the callback given to registerAllFlagsListener is receiving a stringified array of feature flags instead of an actual array of strings. This is inconsistent with iOS & the typescript definitions provided by the library.

See images below:

Type definition + example code:
Screen Shot 2021-09-03 at 10 36 09 am

Console output:
Screen Shot 2021-09-03 at 10 36 20 am

To reproduce
On a brand new app, initialise the LaunchDarkly SDK & use the following snippet:

client = new LaunchDarkly();
client.registerAllFlagsListener('ALL_FLAGS_LISTENER', (updatedFlags) => {
    console.log(typeof updatedFlags);
});

Then run the app on both iOS and Android and update a feature flag from the LaunchDarkly web app. The behaviour will differ between platforms.

Expected behavior
An array of strings representing which flags have changed should be passed in to the callback.

Logs
Non applicable.

SDK version

"launchdarkly-react-native-client-sdk": "5.0.0"

Language version, developer tools
Non applicable.

OS/platform

  • MacOS Big Sur
  • Android 9
  • Tested on both React Native 0.65.1 & 0.64.2

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