Page MenuHomePhabricator

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

Authored by ashoat on Apr 13 2024, 4:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 10:45 AM
Unknown Object (File)
Wed, Oct 16, 3:19 AM
Unknown Object (File)
Oct 13 2024, 1:27 AM
Unknown Object (File)
Oct 13 2024, 1:27 AM
Unknown Object (File)
Oct 13 2024, 1:27 AM
Unknown Object (File)
Oct 13 2024, 1:27 AM
Unknown Object (File)
Oct 13 2024, 1:26 AM
Unknown Object (File)
Oct 11 2024, 2:03 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.Apr 15 2024, 1:58 AM