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

Fix: forget account for legacy account without authorizedAccounts #1381

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

Tbaut
Copy link
Contributor

@Tbaut Tbaut commented Jun 28, 2024

closes #1376

I managed to reproduce, here are the details for this to happen:

  • you need a state with the old version of the extension where you have a non empty authUrls list, which means that you have ever connected at least an account to a dapp. Checkout commit 4edd9cd for instance.
  • once this is done, upgrade the extension to master: there's no state migration per se
  • if you ever visit a website you had visited before, one that is present in your authUrls, then you'll need to set the authorizations for this website again, as in, it used to be available for all accounts, now you need to specify. Doing so will set authorizedAccounts for this website.
  • if you try to forget an account, and you have at least one entry in your authorizedAccounts that doesn't have authUrls, then it'll crash.

The fix is super simple once this is clear, authorizedAccounts can be undefined and shouldn't prevent us from removing an account.

Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

Thank you so much! Awesome reproduction!

@Tbaut Tbaut merged commit 0a52b5d into master Jun 28, 2024
3 checks passed
@Tbaut Tbaut deleted the tbaut-fix-forget-account branch June 28, 2024 14:43
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jun 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression. Cannot forget account. v0.47.5
3 participants