question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gracefully handle the case where inputs to multiSet are not of the type Array<Array<String>>

See original GitHub issue

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 the keyValuePairs 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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xiurobertcommented, Mar 27, 2021

@kiranjd Another possibility would be to handle the case where multiSet is called with n arguments

1reaction
tido64commented, Mar 27, 2021

@kiranjd: Please go ahead and submit a PR 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiset Operators
MULTISET EXCEPT takes as arguments two nested tables and returns a nested table whose elements are in the first nested table but not...
Read more >
Multiset in C++ Standard Template Library (STL)
Multisets are a type of associative containers similar to the set, with the exception that multiple elements can have the same values.
Read more >
std::multiset - cppreference.com
std::multiset is an associative container that contains a sorted set of objects of type Key. Unlike set, multiple keys with equivalent ...
Read more >
Why multiset keeps separate instances of repeated elements ...
The reason sorted containers typically check equivalence not equality is that they need a way to compare elements anyhow (they are sorted).
Read more >
Multiset-Equivariant Set Prediction with Approximate Implicit ...
Most set prediction models in deep learning use set-equivariant operations, but they actually operate on multisets. We show that set-equivariant functions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found