Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP-5843: Fix App Crash on Connected Sites #739

Merged
merged 3 commits into from
Jul 6, 2023
Merged

CP-5843: Fix App Crash on Connected Sites #739

merged 3 commits into from
Jul 6, 2023

Conversation

atn4z7
Copy link
Collaborator

@atn4z7 atn4z7 commented Jul 5, 2023

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

  • I have performed a self-review of my code
  • I have verified the code works
  • I have added necessary unit tests

adeamos83
adeamos83 previously approved these changes Jul 5, 2023
@@ -61,6 +63,22 @@ public ReactNativeHost getReactNativeHost() {
@Override
public void onCreate() {
super.onCreate();

// Temp workaround for data not getting persisted on Android

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great comments on helping others understand

@atn4z7 atn4z7 changed the title CP-5842: Fix Android not persisting data on some devices CP-5843: Fix App Crash on Connected Sites Jul 5, 2023
@atn4z7 atn4z7 dismissed stale reviews from ruijialin-avalabs and adeamos83 via 0d0ccf4 July 5, 2023 22:43
@atn4z7 atn4z7 merged commit a8b883a into development Jul 6, 2023
@atn4z7 atn4z7 deleted the cp-5842 branch July 6, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants