yusinto / ld-redux

A library to integrate launch darkly with react redux
MIT License
34 stars 17 forks source link

`subscribeToChanges` always uses camelCase #63

Closed enceeobee closed 3 years ago

enceeobee commented 3 years ago

Hello 👋 ,

First, thank you for this package! It's wonderful 😄

Issue

I recently noticed that subscribeToChanges always uses a camelCase flag key when updating the store, even when useCamelCaseFlagKeys is set to false.

I don't think the fix should be too difficult, and I can probably supply a PR for it soon, but I wanted to open an issue for posterity.

Steps to reproduce

  1. init ld-redux setting useCamelCaseFlagKeys to false

      ldRedux.init({
        clientSideId: 'your-client-side-id',
        dispatch: store.dispatch,
        useCamelCaseFlagKeys: false
      });
  2. Later, identify a new user, which will dispatch an event(s) to update the store once the new flag values are ready

      window.ldClient.identify({key: 'someUserId'});
  3. Observe that the flag key in the SET_FLAG action is incorrectly sent in camelCase (e.g. 'my-kebab-case-flag' is updated as 'myKebabCaseFlag')

Screenshots

Here's an example of a flag being updated in camelCase, when it should be kebab-case

camelCase
yusinto commented 3 years ago

The fix for this has been merged and released in v3.3.4.