mogol / flutter_secure_storage

A Flutter plugin to store data in secure storage
https://pub.dartlang.org/packages/flutter_secure_storage
BSD 3-Clause "New" or "Revised" License
1.09k stars 340 forks source link

Check contains key with readed value #737

Open koji-1009 opened 2 weeks ago

koji-1009 commented 2 weeks ago

The error #711 indicates that SecItemAdd is being called when it should be SecItemUpdate in some users. This could be a case where (for some reason) errSecItemNotFound is returned from SecItemCopyMatching, but the value is actually saved.

Therefore, instead of SecItemCopyMatching, it has been modified to determine if the key is contains based on the value obtained by read. This implementation is based on v9.0.0.

https://github.com/mogol/flutter_secure_storage/compare/v9.0.0...v9.1.0#diff-9ddc98846efcc4fe8d873eb548ed640010457abc988d46a2d2e2d421f8d29045L38


I would like to get your opinion on the modification.

rvdveen commented 1 week ago

@juliansteenbakker could you retry the failing action? It succeeds on my machine, would be good to have this fix in this awesome library!