-
Notifications
You must be signed in to change notification settings - Fork 557
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
Add new validation and limit for storage #621
Conversation
@@ -87,6 +92,8 @@ export enum ManageStateOperation { | |||
updateState = 'update', | |||
} | |||
|
|||
export const STORAGE_SIZE_LIMIT = 10000; // In bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should decide with the team what this value should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now limited with 100MB in size, as discussed on standup call.
1f234f4
to
5441eac
Compare
Return isObject check Update utils version Return old message Refactor and change size limit
5441eac
to
06bf370
Compare
Codecov Report
@@ Coverage Diff @@
## main #621 +/- ##
=======================================
Coverage 87.57% 87.57%
=======================================
Files 88 88
Lines 2664 2664
Branches 488 488
=======================================
Hits 2333 2333
Misses 311 311
Partials 20 20 Continue to review full report at Codecov.
|
The main goal of this PR is to enforce JSON serializability of the Snap state and limit its size.
This PR will introduce new utility functions for JSON sizing and validation implemented here: MetaMask/utils#14
Fix: #209
Fixes: #571