ammarahm-ed / react-native-mmkv-storage

An ultra fast (0.0002s read/write), small & encrypted mobile key-value storage framework for React Native written in C++ using JSI
https://rnmmkv.now.sh
MIT License
1.59k stars 111 forks source link

[Bug] Some functions are not working #264

Closed pnthach95 closed 2 years ago

pnthach95 commented 2 years ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Clone mmkvtest branch main
  2. Clone my flipper plugin, read this doc to add plugin to flipper
  3. Open terminal on flipper plugin folder, run yarn to install dependencies, run yarn watch to build plugin
  4. Launch Flipper, run app, enable RN MMKV Storage plugin
  5. On app, press buttons, see console logs and Flipper logs

Expected behavior Flipper shows every logs when press buttons on app

Screenshots

Video

Platform Information:

Additional context

Function Async API Sync API transactions
Set boolean
Get boolean 'boolean', 'onread' not working
Set string
Get string Return undefined Return undefined
Set int
Get int 'number', 'onread' not working
Set map 'object', 'onwrite' not working
Get map 'object', 'onread' not working
Set array
Get array 'array', 'onread' not working
ammarahm-ed commented 2 years ago

@pnthach95 Thanks for working on a flipper plugin. Well it's strange that some methods are working and others are not? If you build the app and run without flipper plugin and try to get/set values, that works as usual? it's just not working with flipper? Am i correct?

ammarahm-ed commented 2 years ago

@pnthach95 I have fixed the bug you mentioned. Transactions were not properly implemented. Can you try the master branch, for me all the above methods are now working after the fix.

yarn add https://github.com/ammarahm-ed/react-native-mmkv-storage.git
pnthach95 commented 2 years ago

Tested on master branch, all good. Wait for your release.

ammarahm-ed commented 2 years ago

@pnthach95 I will make the release soon.