Async storage doesn't work when debugging in chrome using genymotion emulator
Using a macbook pro running 10.11.4 El Capitan
Using AsyncStorage api with android geny motion emulator, when debugging in chrome AsyncStorage does not operate
componentWillMount: function() {
var token;
AsyncStorage.getItem('token').then((data) => {
if(data) {
token = data;
return token;
} else {
this.setState({
noAuth: true
});
}
}).then((token) => {
setTimeout (() => {
this.setState({
token: token,
loading: false,
noAuth: true
});
this.props.navigator.push({
id: 'HomeView',
passProps: {'state': this.state},
sceneConfig: Navigator.SceneConfigs.FadeAndroid
});
}, 300);
}).
This seems to run, but my timeout/navigate to never hits the homepage if i'm in debug mode, obviously this presents a few problems because then i can't debug why things aren't working lol. Any guidance would be much appreciated. Thanks.
@facebook-github-bot stack-overflow
Hey @austinksmith and thanks for posting this! @DanielMSchmidt tells me this issue looks like a question that would be best asked on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. Will close this as this is really a question that should be asked on SO.
I think you've misunderstood the question a bit, asyncstorage doesn't function when debugging in chrome and using the emulator. This to me is a major bug as it prevents me from debugging my application.
Sorry for that 😞 @facebook-github-bot reopen
It seems to be intermittent when it works, when running on an actual device everything appears to function fine. My use case is basically, I have a splash/login screen and when someone logs in I'm saving a token using asyncstorage, in my homeview I fetch that token from asyncstorage and render a list of events. The problem is when debugging about 70% of the time the homescreen will simply hang, my breakpoints never get hit and the application does not freeze I can still reload the js and enable the perf monitor but it appears my token is never getting fetched from storage which is required for me to authenticate with my api endpoint and render my events so i'm met with my homepage without any events.
I'm emulating a Nexus 5 running android 4.4.4 API 19 Running chrome Version 50.0.2661.102 (64-bit) Using a MBP Retina running El Capitan 10.11.4 With the following extensions https://www.dropbox.com/s/tdd7zwwnhswul7i/Screenshot%202016-05-20%2016.13.32.png?dl=0
I have the same issue. @DanielMSchmidt It seems like the github-bot failed in reopening the issue.
I have the same issue. When DEBUG JS Remotely is on, accessing AsyncStorage via redux-persist just hang. It works well on iOS.
@facebook-github-bot reopen
Okay, reopening this issue.
i'm having the same problem running rn-0.31 on the android emulator (Android 6.01) and on a nexus 4 device. computer is a thinkpad x220 running ubuntu 16.04 chrome version 52.0.2743.82
UPDATE: it seems weird, but implementing the 'Delay Render Until Rehydration Complete' recipe from the redux-persist repo (https://github.com/rt2zz/redux-persist/blob/master/docs/recipes.md) solved the issue for me...
@thorstenweber83 I don't know why, but I also confirmed that the Delay Render Until Rehydration Complete solved the issue. @rt2zz Any thoughts?
I'm getting the same issue in chrome too. Nexus 5 with remote debugging through chrome. React native version 31.0
After throwing in a few console logs, it seems the callback registered when calling RCTAsyncStorage.multiGet in Libraries/Storage/AsyncStorage.js never gets called. Everything works fine on the device though so it seems to be an issue with the debugger.
Same issue. Sometimes the debugger works fine, sometimes AsyncStorage is (really) slow (3-9 seconds, and I've even seen it take 9 minutes for AsyncStorage.multiGet to return, and sometimes it appears to hang indefinitely (15+ minutes). Turning off Debug JS Remotely seems to solve the issue immediately. Interestingly, I haven't seen the issue occur during the first reload when you turn the debugger on.
I'm running: (actual device) Nexus 5x on 7.1.1 Chrome 54.0.2840.71 React Native 0.35.0
Edit: I was also already using the 'Delay Render Until Rehydration Complete' recipe, so that seems to have had no effect for me
This could be the same issue that we are facing here #12830 (no solutions).
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
- Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
- If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
- Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
Same issue.
I think this problem should be payed attention.
There seems to be a trend of closing out issues when they're only inactive due to users waiting for response from maintainers...not a great practice. Here we are almost 2 years later and this still hasn't been addressed.
The two month inactivity period before closing can be bumped up now that we have a smaller number of open issues, but I'd still recommend submitting a pull request as a more appropriate long term fix. We lean heavily on the community providing fixes for issues they run into. Please tag this issue if a PR is submitted and we can re-open it.
@hramos if you don't have anyone to look at the issue how about you write that on the issue and then perhaps someone can pick it up and submit the PR. I don't see what the practice of closing issues that you have not even attempted to reproduce really achieves apart from artificially reducing your list of outstanding issues. I've seen this happen a lot on the react-native project and it's pretty depressing to see a project being run like this.
Maybe related to #14101