react-native icon indicating copy to clipboard operation
react-native copied to clipboard

RCTAsyncStorage.getAllKey callback does not happen RN 0.31 Android 4.2.2 when debugging

Open eranbes opened this issue 10 years ago • 9 comments

Android 4.2.2 RN 0.31

RCTAsyncStorage.getAllKeys(function(error, keys) { line in AsyncStorage.js, getAllKeys method never gets to callback when debugging in chrome. Also, AsyncStorage.js chooses to use sqlite implementation (at least in the chrome debugger).

This issue happen only in debug.

eranbes avatar Aug 09 '16 14:08 eranbes

I have replicated this issue on 0.31 and 0.32.0-rc.0.

I can confirm that AsyncStorage.getAllKeys works while running on the device normally, but not when debugging JS remotely in Chrome.

EDIT: Replicated on Android 6.0.1 with a Oneplus One and Nexus 9, so don't think it's related to your version of Android.

corbt avatar Aug 11 '16 20:08 corbt

I'm also experiencing this issue. It means I haven't been able to use the chrome debugger since upgrading to 0.31. Anyone have any workarounds for now?

alenia avatar Aug 12 '16 18:08 alenia

@alenia nope, still broken for me. Haven't had a chance to investigate.

corbt avatar Aug 12 '16 19:08 corbt

I have the same issue, it works as expected in 0.30.

I have downgraded until the cause is determined. I have tested on a Nexus 5 a 6.0.1, and a Nexus 6P at N preview 5

kageurufu avatar Aug 12 '16 23:08 kageurufu

I hit this as well in 0.32.0-rc. I suspect that the commit in 0.31.0 (c89c25f27d115c1928104b06dbe6eabf005995a6) which makes the new bridge the default bridge introduced the issue.

rigdern avatar Aug 16 '16 18:08 rigdern

@cjhopman, do you have any thoughts on this issue. Do you think my theory about your commit (c89c25f27d115c1928104b06dbe6eabf005995a6) is accurate?

rigdern avatar Aug 17 '16 00:08 rigdern

@rigdern the bridge is definitely the issue. I modified my MainApplication to call setUseOldBridge(true) in the ReactNativeHost subclass, and I'm now able to use AsyncStorage while debugging on Android with 0.31.0

I don't have the time to debug this issue fully beyond that, but for those experiencing this issue, I posted a workaround: https://gist.github.com/kageurufu/79e4aaa1c41cbdb147e936d7e473029d

kageurufu avatar Aug 17 '16 20:08 kageurufu

@rigdern Thanks for looking into it! I'll ping @cjhopman and @mhorowitz on fb@work messenger.

mkonicek avatar Aug 20 '16 14:08 mkonicek

Closing in favor of https://github.com/facebook/react-native/issues/9436

lexs avatar Aug 23 '16 10:08 lexs