react-native-mmkv icon indicating copy to clipboard operation
react-native-mmkv copied to clipboard

Recover from data corruption support?

Open RZulfikri opened this issue 2 years ago • 2 comments

@mrousavy wanna ask, does this library support Recover from data corruption ? I think this feature is quite important.

RZulfikri avatar Aug 08 '22 13:08 RZulfikri

I didn't implement it because:

The repair rate is not promised, though. And you might get unexpected key values from recovery

And to me that's not a fair tradeoff. If the data really gets corrupted, it's probably safer to restart the app with a clean state instead of a partial repaired or weird/broken state.

mrousavy avatar Aug 08 '22 13:08 mrousavy

I see. But, can you give me any clue on how to implement this? In my case, once data is corrupted it will break the session that is stored and force users to re-login. so instead of re-login, I wanna keep users login and then re-fetch the data from API if needed.

RZulfikri avatar Aug 08 '22 13:08 RZulfikri