Replies: 2 comments
-
I understand that it's a problem. I will look into it later. |
Beta Was this translation helpful? Give feedback.
0 replies
-
It's released with v1.3.3. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First, this is a fantastic library, and I thank you for the hard work that went into creating it and continues to go into maintaining it.
Here's my situation: We are using the encryption key for added security for a particular MMKV instance. We create a crypto key that we store in a secure way, and then retrieve and use this key to decrypt the instance. In very rare circumstances, the key may fail to be returned, in which case we have to create a new key. However, if there is already an encrypted instance with this ID, we have no way to remove the previous data.
If the MMKV for this ID is initialized with the wrong key, it throws an error, and this is clearly expected. However, without an instance, there is no way to clear the data (
clearAll
). There is also no way to overwrite the file with an identical ID. For example, I have tried first creating an unencrypted instance with the same ID, and usingreKey
. However, once there is an encrypted file, the only way to remove its data is with the correct key.This is unfortunate and not really expected behavior, in my opinion. Perhaps, there should be a way to either delete the old data, or a method to overwrite data of a particular ID. Without this functionality, we would presumably have to manage the files and paths manually, and delete the offending files before trying to create a new instance.
I'm not sure if this is within the scope of this project, but I feel like there's a good argument that it should be.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions