Skip to content

Move source code and snap state back to controller state #1634

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

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Jul 22, 2023

Moves the source code and snap state from SnapRuntimeData to the SnapController state. This fixes a bug with persistence of snap state and source code changes. This change by itself will worsen performance of the extension, so it should be coupled with a change to filter source code and snap state from the state piped to the extension UI.

This PR also allows us to move snapsRuntimeData to hash private.

Fixes #1633

@codecov
Copy link

codecov bot commented Jul 22, 2023

Codecov Report

Merging #1634 (75ea34e) into main (77912d4) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1634      +/-   ##
==========================================
- Coverage   95.78%   95.77%   -0.02%     
==========================================
  Files         235      235              
  Lines        5342     5324      -18     
  Branches      819      817       -2     
==========================================
- Hits         5117     5099      -18     
  Misses        225      225              
Impacted Files Coverage Δ
packages/snaps-utils/src/snaps.ts 98.85% <ø> (ø)
...ages/snaps-controllers/src/snaps/SnapController.ts 96.44% <100.00%> (-0.10%) ⬇️

@FrederikBolding FrederikBolding marked this pull request as ready for review July 22, 2023 10:03
@FrederikBolding FrederikBolding requested a review from a team as a code owner July 22, 2023 10:03
@Mrtenz Mrtenz merged commit b408ebc into main Jul 24, 2023
@Mrtenz Mrtenz deleted the fb/fix-runtime-persistence branch July 24, 2023 10:21
FrederikBolding added a commit that referenced this pull request Aug 7, 2023
* Move source code and snap state back to controller state

* Update coverage
FrederikBolding added a commit that referenced this pull request Aug 8, 2023
* Move source code and snap state back to controller state

* Update coverage
Gudahtt pushed a commit that referenced this pull request Aug 14, 2023
* Move source code and snap state back to controller state

* Update coverage
FrederikBolding added a commit that referenced this pull request Dec 4, 2023
In #1634 we removed the source
code and snap state from the runtime type. But the data was still being
saved wastefully in memory. This PR fixes this.
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.

Make sure changes to SnapRuntimeData are correctly persisted
2 participants