Closed wbt closed 6 years ago
Thank you for this hugely detailed response!
The "Reset account" function needs to perform a full network selection (restart the provider).
The problem is that our cache isn't perfect when private networks change. We can either:
Reset Account
in those cases. #2623.I think the cache is actually very valuable to our provider API's health, so I don't think that's a reasonable option. Since the second option has two components, and one is already captured as #2623, I think this issue's requirements should be considered:
"Reset account" needs to perform a full network selection (restart provider).
This issue still seems to persist. We have a bunch of our users report that their balances are incorrect. Resetting their account usually does it for them. Is there any other solution?
@mrwillis are you able to reproduce consistently? We see this issue occasionally but have trouble identifying reliable steps to help us debug.
if you are able to, it'd be a huge help - feel free to open a new issue.
Yes we have the same issue. Cannot reliably reproduce :(
On Mon., Mar. 25, 2019, 3:07 p.m. bobby dresser, notifications@github.com wrote:
@mrwillis https://github.com/mrwillis are you able to reproduce consistently? We see this issue occasionally but have trouble identifying reliable steps to help us debug.
if you are able to, it'd be a huge help - feel free to open a new issue.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MetaMask/metamask-extension/issues/3439#issuecomment-476336880, or mute the thread https://github.com/notifications/unsubscribe-auth/ACh6CwiIbu7r2ItwDu-Jc8qR5HZZDGQNks5vaR6LgaJpZM4Sdlvo .
Metamask caches blockchain data and displays old data even after an account reset.
If the network is reset, Metamask will continue to display cached data from the previous state of the blockchain, and display all transactions as permanently pending, until the new blockchain is longer than the old one was. Transactions sent at/after that moment will be marked successful (if appropriate) and Metamask will start returning information from the current blockchain instead of the previous one. Even then, the previously sent transactions remain in a pending state, although the transactions succeeded and their effects are visible on the information shown after the new instance of the blockchain became longer than what came before.
The workaround is to use Metamask’s network selector to switch networks away from and then back to the network being reset. “Reset account” is not sufficient to clear the cache and trigger MetaMask to start reading from the blockchain network as it currently stands (instead of reading from cache).
The expected behavior is for Metamask to always return information which reflects information currently stored on the blockchain, instead of returning cached versions of a previous instance of the blockchain. A second-choice fallback would clear Metamask’s cache of a network, in the same way it does when changing networks, when the user manually chooses Reset Account.
This is an issue on networks that get reset, primarily private test networks.
Here were my steps to reproduce:
Note that in this dapp, the information read from the blockchain did not require any account private keys, so any reset specific to one account might not be broad enough to cover the information being read.
I suspect step 31 is a different bug, but haven't gotten that one isolated or well-documented enough to report yet.