Closed georgeflug closed 11 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
rnmmkv | ✅ Ready (Inspect) | Visit Preview | Jan 3, 2023 at 6:00PM (UTC) |
Hi, using a new key if the existing key did not exist means the data encrypted with older key will not exist anymore. It will be wiped and replaced with new data. I am not sure if it's a good solution yet to immediately create a new key & and a new storage instance.
This fixes a few issues I've seen in a production app with encrypted storage.
This moves the
initWithEncryptionWithoutSecureStorage
call higher up because the app was crashing when trying to access secure storage on an instance that did not use secure storage. It was going down theif (IDStore.exists(id))
path which ultimately tried to encrypt with a key stored in secure storage even though it was configured to not use secure storage. This fixes #265This also moves the
initWithEncryptionUsingNewKey
call higher up because the app got into a bad state where theIDStore.exists(id)
call was returning true but themmkvJsiModule.getSecureKey
call was returning nothing. I'm not sure how it got into the bad state but it may be related to the problem that was fixed by 0.8.0. If the secure key does not exist, it should use a new key instead of continually trying to use the nonexistent key.