fix(storage): route empty-string writes to removeItem to avoid keychain rejection

This commit is contained in:
Evan Kaloudis
2026-05-17 13:42:54 -04:00
parent 65813738d2
commit bfe2393250
+5 -5
View File
@@ -25,11 +25,11 @@ class Storage {
const stringValue =
typeof value === 'string' ? value : JSON.stringify(value);
if (stringValue == null) {
console.error(
`Storage.setItem: cannot store null/undefined for key "${key}"`
);
return false;
// Keychain rejects empty/null passwords with EmptyParameterException.
// getItem returns `false` for both unset and empty values, so routing
// empty writes through removeItem preserves the observable semantics.
if (stringValue == null || stringValue === '') {
return this.removeItem(key);
}
const response = await Keychain.setInternetCredentials(