-
Notifications
You must be signed in to change notification settings - Fork 466
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
AsyncStorage.getItem blocks when debugging remotely #11
Comments
Maybe we should use import { AsyncStorage } from 'react-native';
const rejectOnTimeout = ms =>
new Promise((_, reject) =>
setTimeout(() => reject(new Error('Timeout!')), ms),
);
export const Storage = {
getItems(...args) {
return Promise.race([
rejectOnTimeout(30 * 1000),
AsyncStorage.getItem(...args),
]);
},
}; |
Maybe it is related to #50 ( |
Hey 👋 Since this issue is not really active, I'm closing it. If someone how across same problem, please open a new one with repro steps/more info, so we can track it down. thanks. |
This is still happening, as everyone has posted for a few years now ;) |
this is still a problem. that took hours to find in fact. |
Yep this is still a problem |
This issue was originally created by @bartolkaruza as facebook/react-native#12830.
Description
In some situations when calling AsyncStorage.getItem, either with a callback, calling
then
or usingasync await
, the proceeding callback is not called and the promise does not resolve. This only happens when the remote debugger is on.result or error are not called below:
AFTER is not printed (and no error is thrown):
The same code above completes the first time (and several consecutive times) it is run in the same debug session but blocks at a later stage. The point in time where it starts blocking is consistent in my app, so there is a piece of context that I haven't found yet which is causing it. I will continue searching for this context. Are maybe others running into similar behavior?
No matter the availability of data, getItem should always resolve (or reject), right?
Reproduction
I will keep trying to isolate the reproduction but so far I have not been able to cleanly reproduce, but in my full app, it is consistently occurring.
Solution
Additional Information
This issue is occurring on both iOS devices and simulators. I haven't seen it on Android yet.
OS X 10.11.6
Xcode 8.2.1
React Native Debugger 0.5.6
React Native 0.42.0
The text was updated successfully, but these errors were encountered: