Skip to content

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Jan 20, 2025

This PR contains a couple changes related to JSON size validation in the snap_manageState and snap_setState methods:

  • The maximum size was reduced from 100 MB to 64 MB. This is to because window.postMessage breaks when sending payloads that are too large. This is technically a breaking change, but I'm not sure if it should be considered as one, given that the execution environment would throw regardless, if the new state is too big?
  • snap_setState now properly validates the size of the new state, like snap_manageState does.

@Mrtenz Mrtenz requested a review from a team as a code owner January 20, 2025 13:34
@Mrtenz Mrtenz merged commit 3dfdd04 into main Jan 20, 2025
164 checks passed
@Mrtenz Mrtenz deleted the mrtenz/state-size-validation branch January 20, 2025 13:50
@codecov
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.76%. Comparing base (687b582) to head (8829423).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3025   +/-   ##
=======================================
  Coverage   94.76%   94.76%           
=======================================
  Files         499      499           
  Lines       10906    10906           
  Branches     1674     1672    -2     
=======================================
  Hits        10335    10335           
  Misses        571      571           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

3 participants