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

should better handle unexpected change of account #2059

Closed
dkent600 opened this issue Aug 12, 2020 · 3 comments
Closed

should better handle unexpected change of account #2059

dkent600 opened this issue Aug 12, 2020 · 3 comments
Labels

Comments

@dkent600
Copy link
Contributor

There is a challenge in Alchemy where the following happens:

  1. you are using MetaMask
  2. you are running Alchemy and the current account 0x1 is taken from the localStorage cache, and your account is not yet connected (readonly mode)
  3. account 0x2 is currently selected in MetaMask
  4. you attempt any operation that will require signing in MetaMask
  5. the operation automatically tries to connect your account
  6. you are successfully connected and the Alchemy current account automatically switches to 0x2

At this point the operation you attempted in step 4 will be attempted on one account or the other, 0x1 or 0x2. Which account depends on asynchronous timing, but it can easily happen that an error will occur and the UI may not handle it well. Or the operation originally attempted by 0x1 may be performed on behalf of 0x2 instead, and succeed, which would not feel like a success from the user's point of view.

I think the best approach to this is to require a connection earlier in the workflow.

Second is to detect when the account changes in this scenario and abort with an appropriate notification message.

One place where this is an issue is when (un)following a DAO or proposal.

@orenyodfat
Copy link
Contributor

at 2.0 or 1.0 ?

@dkent600
Copy link
Contributor Author

at 2.0 or 1.0 ?

Both

@orenyodfat
Copy link
Contributor

at 2.0 or 1.0 ?

Both

so lets start fix that on 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants