CP-5843: Fix App Crash on Connected Sites #739
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Problem:
App will crash when going to Connected Sites screen
Cause:
Our data in redux has grown and it is causing some Android devices to not be able to persist the data correctly. We haven't added new things to the store in awhile so my guess is some backend data (like tokenlist, bridge config,...) has increased in size. Anyway, due to this, the wallet state is not getting persisted which causes features such as Wallet Connect not being initialized at app start. This causes a crash when going to Connected Sites screen.
Temp solution:
This pr increases the size limit of AsyncStorage as well as the CursorWindow that is used to read the data. This allows our app data to be persisted as normally. I also added a try catch around session retrieving logic to prevent crashing in case we fail to init Wallet Connect for any reason.
Long term solutions:
https://ava-labs.atlassian.net/browse/CP-5844
https://ava-labs.atlassian.net/browse/CP-5169
References:
rt2zz/redux-persist#199
rt2zz/redux-persist#960
https://react-native-async-storage.github.io/async-storage/docs/limits/#:~:text=Total%20storage%20size%20is%20capped,new%20size%20using%20feature%20flag.
Checklist for the author