Open sentry-io[bot] opened 1 month ago
Testing on Android emulator (issue doesn't occur on iOS, and I was not able to test on physical Android device) did not show any critical degradation of functionality after this error has occurred.
Cal and I have done some digging and since the AsyncStorage.setItem() method will error out once it hits the limit on Android, that means that it essentially destroys the app's ability to storage values in AsyncStorage. When this occurs, the app won't even get past the splash screen (doesn't even get to onboarding, see video). Our conclusion is that this shines on a larger issue, that our app needs to be able to still function when AsyncStorage fails, even if it functions in a degraded state.
https://github.com/MetaMask/metamask-mobile/assets/6249205/0742d45d-83b3-4d7e-b71f-6eec3103488e
Repurposing this ticket to ensure that app still works without Async storage
Sentry Issue: METAMASK-MOBILE-2CVQ
Technical Details
In this iteration, we should migrate
async-storage-wrapper.js
to accessMMKV
instead of AsyncStorage since it doesn't have the limitations that AsyncStorage has. To do so, we should leveragegetItem
,setItem
, andremoveItem
from the wrapper class to perform this migration. In each method.getItem
-> Attempt to access key inMMKV
. Then fallback to getting key via AsyncStorage. Set item inMMKV
if we're able to get the key successfully from AsyncStorage.setItem
-> Replace storage withMMKV
removeItem
-> Also remove item fromMMKV
Acceptance Criteria