-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
storage limitthis issue is prioritizedStory in develop or in releaseStory in develop or in releasetype-bugSomething isn't workingSomething isn't working
Description
Description
In the mobile application we are starting to see a Storage Limit Error becoming a more frequent reported issue. This requires the user to setup their wallet each time this error is thrown. The evidence seems to suggest that since we are saving the entire redux state for the app and decrypting it upon login it opens up the potential for data corruption causing the error.
Focus:
- Store the opt-in to metrics in a different location to allow this issue to be logged.
- Limit the amount of user generated data that can be stored (e.g. Txs, NFTs). The extension only stores the latest 100 Txs across all accounts.
Technical Requirements
- Pull at least the
analyticsfield from redux persist into it's own key so that it's not nested under therootkey. Hint: Look at the analytics reducer, that's whereanalyticsis being set. This addresses focus number one. - Regarding limiting TXs, limit/truncate the incoming TXs count to 40. This addresses focus number two.
- Will most likely need to update analytics reducer.
- May have to update tests related to redux
- Add to
controlleraddTransaction() see extension reference
Acceptance Criteria
- Ensure that the
analyticsfield that controls MetaMetrics is stored outside of therootkey in redux-persist. - Somehow emulate the corrupt storage scenario and verify that events are still being tracked
- Ensure that the max number of TXs cached is 40.
- Still be able to view transactions on different accounts
References
- Proposal of issue & potential solutions - https://consensys.slack.com/archives/GBW7S9FSN/p1626126984211600
- Original issue - https://app.zenhub.com/workspaces/metamask-mobile-5f984938ddc0e4001d4b79cb/issues/metamask/metamask-mobile/2652
- Extension Code: tx-state-manager.js - line 192
- // checks if the length of the tx history is longer then desired persistence
// limit and then if it is removes the oldest confirmed or rejected tx.
// Pending or unapproved transactions will not be removed by this
// operation. For safety of presenting a fully functional transaction UI
// representation, this function will not break apart transactions with the
// same nonce, per network. Not accounting for transactions of the same
// nonce and network combo can result in confusing or broken experiences
// in the UI.
- // checks if the length of the tx history is longer then desired persistence
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
storage limitthis issue is prioritizedStory in develop or in releaseStory in develop or in releasetype-bugSomething isn't workingSomething isn't working