HomePhabricator
Diffusion Comm 4cb7c1c15b0c

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

Description

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

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.

Reviewers: marcin, tomek

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D11660

Details

Provenance
ashoatAuthored on Apr 13 2024, 1:39 PM
Reviewer
tomek
Differential Revision
D11660: [native] Recreate CommMMKV keys if they can't be loaded
Parents
rCOMMc7ea09fab8ba: [native][android] Move database and MMKV initialization to…
Branches
Unknown
Tags
Unknown