flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

resetOnError returns String

Open itsJoKr opened this issue 2 years ago • 0 comments

The method in question is main method of this package and that's String? read(String key).

You use it, you save and read keys, you code your app around the premise that it returns string when it has saved entry with associated key.

But then, this fix for resetOnError: true will return plain string for this method Data has been reset which is very unexpected. Obviously rest of the app thinks that string is result for the saved key, because that's how the method read is supposed to work.

Proposition:

  • Log the issue and return null

itsJoKr avatar Jul 21 '22 07:07 itsJoKr