-
Notifications
You must be signed in to change notification settings - Fork 475
Gracefully handle the case where inputs to multiSet are not of the type Array<Array<String>> #519
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
Comments
I would like to work on this |
@kiranjd: Please go ahead and submit a PR 😃 |
@kiranjd Another possibility would be to handle the case where |
@xiurobert That approach might not work as the second arg could be passed as well. |
As I looked to add regression tests, I see that Maybe we can create adding tests as issues and then add them incrementally? |
🎉 This issue has been resolved in version 1.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Motivation
At present, React Native applications will crash when
AsyncStorage.multiSet
is called with invalid arguments, for example,AsyncStorage.multiSet(['a', 'b'], ['c', 'd'])
. Note that in this case, there are 2 arguments provided to the function for thekeyValuePairs
required to store as data. However, this happens to be a typo and the developer actually intended to wrap it with square brackets, but failed to do so.Since there is no error thrown, the application literally just crashes and makes debugging almost impossible.
Description
An exception should be raised when the type of the inputs to the keyValuePairs argument of multiSet is incorrect, instead of simply letting the application crash.
New feature implementation
Type comparison of the first argument would be crucial in correcting this.
The text was updated successfully, but these errors were encountered: