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

multiGet does not report errors #105

Closed
moughxyz opened this issue May 14, 2019 · 1 comment
Closed

multiGet does not report errors #105

moughxyz opened this issue May 14, 2019 · 1 comment

Comments

@moughxyz
Copy link

In https:/react-native-community/react-native-async-storage/blob/608e2d80cd4a8aa3dbb2f7c08fb317ce4a180344/lib/AsyncStorage.js#L226 errors is ignored, and does not propagate up to caller.

I was able to determine this when I noticed some of my items were coming back undefined. If I used AsyncStorage.getItem, then I correctly saw why the item was coming back undefined: Cursor Window: Window is full (the item I was trying to retrieve was greater than 1MB, which seems to be the limit.)

But when using multiGet, the operation would fail silently.

One solution would be to reject if errors:

if(errors) {
  request.reject && request.reject(errors);
} else {
  request.resolve && request.resolve(requestResult);
}

The current implementation resolves indiscriminately:

https:/react-native-community/react-native-async-storage/blob/608e2d80cd4a8aa3dbb2f7c08fb317ce4a180344/lib/AsyncStorage.js#L244

@react-native-community/async-storage 1.4.0

@krizzu krizzu added LEGACY and removed LEGACY labels Jun 18, 2019
@krizzu
Copy link
Member

krizzu commented Jul 4, 2019

@mobitar

Good catch. We have similar situation with CursorWindow in other issue.

In the upcoming v2, I'm going to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants