Page MenuHomePhabricator

[native] Recreate CommMMKV keys if they can't be loaded
ClosedPublic

Authored by ashoat on Sat, Apr 13, 4:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 11:27 PM
Unknown Object (File)
Sat, Apr 27, 5:10 PM
Unknown Object (File)
Fri, Apr 26, 5:34 PM
Unknown Object (File)
Fri, Apr 26, 7:04 AM
Unknown Object (File)
Wed, Apr 24, 5:31 PM
Unknown Object (File)
Wed, Apr 24, 10:32 AM
Unknown Object (File)
Tue, Apr 23, 1:20 PM
Unknown Object (File)
Mon, Apr 22, 11:06 AM
Subscribers
None

Details

Summary

If we get into a bad state, sometimes we're unable to load these keys. Concretely, without the prior diff sometimes on app start we could get into a situation where the keys are not set up correctly, and fetching them results in this fatal error.

Unfortunately, these are only some of the kinds of CommSecureStore keys that can be corrupted on Android 14 due to our initialization patterns. We have a harder time handling situations where other keys, such as the database or notif session keys, are corrupted. I wasn't able to come up with a solution for all of those, unfortunately.

Depends on D11659

Test Plan

During testing I was able to encounter a situation where the database keys were fine, but the MMKV keys were broken. After fixing the MMKV keys, I was able to get to the app, but notifs were broken.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek added inline comments.
native/android/app/src/main/java/app/comm/android/fbjni/CommMMKV.java
62–63 ↗(On Diff #39099)

We should add a comment or a log instead of having an empty catch.

This revision is now accepted and ready to land.Mon, Apr 15, 1:58 AM