-
-
Notifications
You must be signed in to change notification settings - Fork 323
Open
Description
Hi Team,
We are seeing an intermittent but impactful issue where the encrypted MMKV instance sometimes comes back empty after the app is backgrounded or force-closed for a period, resulting in user logout and loss of cached session/context. Looking for guidance to diagnose and confirm whether this is a corruption, flushing, or decoding/encryption edge case.
Summary
- Normal operation: Reads/writes work reliably while the app is active.
- Problem: After backgrounding or the OS/user killing the app (and reopening minutes later), the MMKV store occasionally initializes empty.
- Frequency: Sporadic but frequent enough to affect production users.
- Error observed (Android & iOS logs):
- MiniPBCoder.cpp:591::decodeOneMap InvalidProtocolBuffer truncatedMessage
- [E] MiniPBCoder.cpp:591::decodeOneMap InvalidProtocolBuffer truncatedMessage
- Encryption is enabled.
- One stored value is a JSON string (~4.9 kB). All other keys are very small (tokens, flags, etc.).
Steps to (Intermittently) Reproduce
- Launch app; write several small keys plus one ~4.9 kB JSON string.
- Confirm keys exist via getAllKeys().
- Background app OR swipe-kill.
- Wait 10–30+ minutes (sometimes less).
- Relaunch.
- Observe: storage is empty; decode error logged natively.
ninad-joshi-asurion, xaviraol, beliven-sebastjan-cej, ottor-o and aeresc
Metadata
Metadata
Assignees
Labels
No labels