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

⚡️ Fast wallet switching #940

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

christianbaroni
Copy link
Member

@christianbaroni christianbaroni commented Sep 13, 2023

What changed

  • Fixes a bug caused by saving the current address directly to a persisted store, where switching wallets quickly with the number shortcuts would trigger an infinite wallet switching loop — we'd previously patched the issue by adding a delay to wallet switching
  • This PR removes the delay and introduces a passthrough store that isn't persisted and can accept rapid updates without issue
  • The selected wallet is saved in the background to the persisted store, and also read on launch from the persisted store
  • Original issue: BX-771

(Not sure why the persisted store causes the loop, but it doesn't occur if the store isn't persisted)

Screen recordings / screenshots

💡 These videos show the max speed you can switch at — each switch was the result of a number key press

Before:

Screen.Recording.2023-09-13.at.1.57.51.PM.mov

After:

Screen.Recording.2023-09-13.at.1.56.08.PM.mov

What to test

  • Shouldn't have any side effects other than allowing faster wallet switching
  • Should migrate cleanly and pick up your last selected wallet on first launch

Final checklist

  • I have tested my changes in a LavaMoat bundle (yarn build).
  • I have tested my changes in Chrome & Brave.
  • If your changes are visual, did you check both the light and dark themes?

Fixes a bug caused by saving the current address directly to a persisted store
@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-c04e307647b35044d6b82d811a63f653f981c5ae.zip

@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-d6e70ba0004c0278c543291c98ce4a79891833c9.zip

Copy link
Contributor

@estebanmino estebanmino left a comment

Choose a reason for hiding this comment

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

fast af

code lgtm

Copy link
Member

@brunobar79 brunobar79 left a comment

Choose a reason for hiding this comment

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

nice

@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-91d69ae1c3172939f2b4fbda4727e1619aee2954.zip

@christianbaroni christianbaroni merged commit c64884f into master Sep 13, 2023
14 checks passed
@christianbaroni christianbaroni deleted the @christian/fast-wallet-switching branch September 13, 2023 23:46
@github-actions
Copy link

Here's the packed extension for this build:
rainbowbx-c64884f8619128eb21a7f9af1875e94d01c745de.zip

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