Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Call persistAllKeyrings in setLocked? #130

@alex-miller-0

Description

@alex-miller-0

GridPlus' keyring recently added a state caching mechanism under a mistaken assumption that serialize would be called when the MetaMask extension locked. Since the Lattice is an internet-connected device with its own state, we would normally need to asynchronously connect to the device in order to sync state, which takes 2-4 seconds, depending on internet connection. With the latest changes, we can now dry state and rehydrate a connection without having to do any asynchronous calls.

However, this is dependent on they keyring controller persisting keyring state or else every time the extension locks, we will lose our most recent state data and we will need to asynchronously reconnect with a retry mechanism (which is actually slower than initially forcing asynchronous resync like we were doing before, since it adds another call that ends up failing and forcing the resync). This would not be an issue if setLocked called persistAllKeyrings to save state.

Is there any reason you do not call persistAllKeyrings in setLocked? And if the answer is no, would you be open to adding that serialization hook?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions