Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[React-Native] triggers uuid crash when feature with impression data enabled is used with isEnabled #87

Closed
Kei-Neurio opened this issue Jun 16, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Kei-Neurio
Copy link

Kei-Neurio commented Jun 16, 2022

Describe the bug

Hi! It's a really specific issue. when a certain word is used for key and run isEnabled() with it, it causes a crash bug which is coming from uuid library. I know that it's a known issue with v4 uuid and there's a monkey patch fix for it, but I figured it's confusing for ones who are not familiar/new to React Native. I have no idea why that particular word triggers this behavior... but I hope this report helps someone come across the same issue. I fixed it by changing the word to pwd but I have a feeling that there are more keywords that triggers this issue.

The straightforward fix for this issue would be installing react-native-get-random-values but it doesn't feel right to bring it only for React Native since this library is for other frameworks too.

dependencies:

"unleash-proxy-client": "1.11.0",
"react-native": "0.66.3",
"react": "17.0.2",

Steps to reproduce the bug

  1. Create a key in unleash that contains the word "password"(e.g. [your-product-name].change-password.enable-screen)
  2. Enable the feature in your unleash console
  3. In your app, trigger isEnabled() function with the key just created

Expected behavior

isEnabled() should return true value.

Logs, error output, etc.

No response

Screenshots

Additional context

No response

Unleash version

1.11.0

Subscription type

Enterprise

Hosting type

No response

SDK information (language and version)

No response

@Kei-Neurio Kei-Neurio added the bug Something isn't working label Jun 16, 2022
@andreas-unleash
Copy link
Contributor

Hey, thank you for bringing this to our attention. I will raise the issue with the team.

@nunogois nunogois self-assigned this Jun 17, 2022
@nunogois
Copy link
Member

Hi @Kei-Neurio thanks for opening this issue and providing detailed information.

From our tests reproducing the bug it seems like this may not be name-related, but instead impression-data-related. We had no issues with password-named feature toggles, but we did have this issue with features that had impression data enabled.

Can you please confirm this? This can be easily changed in Unleash by going to the specific Feature Toggle > Settings > Feature information (edit) > Enable impression data toggle.

Easiest way to fix this for end-users would be to install and add import 'react-native-get-random-values' at the top of their React Native / Expo app, like mentioned here: https://www.npmjs.com/package/uuid#react-native--expo


My suggestion, however, would be to have a specific proxy-client-react-native package, extremely similar to proxy-client-react but with any specific React Native / Expo caveats built-in, providing more of a plug and play experience for end-users.

Here's a quick PoC: proxy-client-react-native

I'll check with the rest of the team on the best way forward regarding this and will let you know 🙂

@Kei-Neurio
Copy link
Author

Kei-Neurio commented Jun 17, 2022

Thank you for the quick response and diagnosis @nunogois! I'll check the impression data toggle and post the result here. Just checked proxy-client-react-native and it's an exciting addition to the project. Looking forward to the update!

[update] Yes you are right, it was caused because we had the impression toggle on👍 I'll leave this issue until some fix goes in place but feel free to close it if you wanted!

@Kei-Neurio Kei-Neurio changed the title [React-Native] triggers uuid crash when certain word is used with isEnabled [React-Native] triggers uuid crash when feature with impression data enabled is used with isEnabled Jun 20, 2022
@nunogois
Copy link
Member

nunogois commented Jul 4, 2022

Hey @Kei-Neurio - Thanks for confirming this!
Our decision for now was to add this React Native/Expo SDK PoC to our Community SDK list here: https://docs.getunleash.io/sdks#community-sdks
If we see it gains traction, we'll probably give more attention to it and promote it to an official SDK. In the meantime, for anyone not using it, there's still the workaround mentioned above.

We'll close this issue for now, but please feel free to reach out to us at anytime 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants