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

Stop including snap state in controller state #876

Merged
merged 5 commits into from Oct 31, 2022

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Oct 26, 2022

Stops including snap state in controller state so it isn't piped to the extension UI. Instead it is stored with runtime information.

@FrederikBolding FrederikBolding marked this pull request as ready for review October 27, 2022 09:30
@FrederikBolding FrederikBolding requested a review from a team as a code owner October 27, 2022 09:30
@FrederikBolding FrederikBolding force-pushed the fb/stop-including-snap-state-in-state branch from f8e3aa9 to 2aaf430 Compare October 31, 2022 12:14
packages/controllers/src/snaps/SnapController.test.ts Outdated Show resolved Hide resolved
packages/controllers/src/snaps/SnapController.test.ts Outdated Show resolved Hide resolved
@@ -188,14 +193,17 @@ type StoredSnaps = Record<SnapId, Snap>;

export type SnapControllerState = {
snaps: StoredSnaps;
snapStates: Record<SnapId, string>;
// This type needs to be defined but is always empty in practice..
Copy link
Member

Choose a reason for hiding this comment

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

Then why does it need to be defined? Can we just remove it?

Also:

Suggested change
// This type needs to be defined but is always empty in practice..
// This type needs to be defined but is always empty in practice.

Copy link
Member Author

Choose a reason for hiding this comment

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

We want to persist snapStates, but not use it as controller state as that is synced with the extension UI. For us to be able to persist it, it has to be included in the SnapControllerState

packages/controllers/src/snaps/SnapController.ts Outdated Show resolved Hide resolved
@FrederikBolding FrederikBolding force-pushed the fb/stop-including-snap-state-in-state branch from 027dd38 to 3bcfb49 Compare October 31, 2022 13:30
@FrederikBolding FrederikBolding merged commit 15212ab into main Oct 31, 2022
@FrederikBolding FrederikBolding deleted the fb/stop-including-snap-state-in-state branch October 31, 2022 14:27
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.

None yet

2 participants