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
Stop reloading dapps on network change #3599
Comments
This is expected behavior since users who switch chains should have an updated UI on the current status of that chain. Since many applications rely on being on a specific network to function, this is a way for us to avoid users getting confused with interacting with a dapp that has residual data from another network. |
Thank you @Zanibas for your answer. I truly belive this should be the responsability of the application developper to listen for chain change, and react accordingly. Let's be honest, forcing a page reload is a disastrous user experience...I really hope there would be a way to avoid this page reload, and let the application developper responsibly react to chainID change... In my case, I detect the chain change by checking the chainID every 100ms... What do you think? Many thanks! |
Any input on this question? Thanks! |
@sulliwane The team actually discussed this a bit, and we ultimately agree with you. Force reloading was a band-aid for a period where developers were just learning to make Dapps, and were almost never using good practices. It is probably time to grow up, and remove these training wheels. Changing the title of this issue to reflect the desired action. |
Many thanks @danfinlay @lazaridiscom for your feedbacks. I'm surprised no other frontend guys did raise this question before... It feels like a terrible user experience to get full reload on each chain change :-( Our Dapp is made from the ground up to support multiple chain ids. |
Are there any cases where non-developer would switch between networks on single application? Full reload would be a terrible experience given users would need to use that. As for developers goes, i think refreshing actually saves time compared to debugging app. |
Yes, more and more apps are recommending custom networks to their users, and as Plasma chains become more common, this will too. MetaMask needs to more seamlessly support this kind of behavior in the future, but in the meanwhile, user interaction is required for those sites. |
Having 28 tabs open ! ! ! ! ! ! ! ! ! ! I hate when switching Metamask there is reloading app somewhere else... EDIT / UPDATE: It displays a popup preventing the reload:
|
My sentiments exactly |
This should be simple enough to implement, and our team is already stretched thin, so I'm marking this as |
Another use case, happened to me 1 second ago:
|
I believe this issue is still not resolved. I have latest version of MM plugin, but still always reloading. |
@sulliwane you're correct, this is not in production yet. We want to make sure dapp developers have plenty of time to prepare for this breaking change. Read more here. We'll roll this out sometime in the next month and will share a specific timeline here when it's solidified. Thanks for being patient! |
@bdresser got it, thank you |
hey @Lucas1313 - we haven't rolled this change out to production yet. Right now, the plan is to include this update as part of our larger breaking change to support EIP 1102, scheduled to launch on Nov. 2. You can read more about 1102 here. As plans for removing the reload finalize we'll post here and share a detailed rollout plan on Medium as well. Thanks for your patience! |
Is there clarity on the current behavior in the Beta or when there will be rollout of this change? I'm on Metamask version 5.0.2 and the page-reload-on-network-change behavior appears inconsistent. It seemed like it stopped but when using Metamask with web3js 1.0.0-beta.36 the behavior reappears. I'm trying to ascertain if the behavior is coming from Metamask or from web3js 1.0.0-beta. The Metamask injected web3js 0.20.3 doesn't cause an auto-reload on network change on my installation. I cannot find any reference to window.location or location.reload in any of the web3js 1.0.0-beta code so I'm concerned this is some interaction with Metamask causing the page refresh. Apologies for posting to a closed issue but there didn't seem to be any notes on final the disposition... |
@lcdupree we still haven't rolled this change out to production yet. After EIP 1102 was finalized, we prioritized messaging & implementation of that breaking change, since its effects on the ecosystem's privacy layer are pretty significant. We still hope to make this change as soon as we have the bandwidth to message & launch smoothly. |
I've just merged #6330, I think it will be of interest to everyone in this thread. It may represent a new feature worthy of closing this issue! Will probably be pushing to production early next week. |
Hi there any good news regarding this issue? |
Wouah! that was the quickest answer ever!, can not believe it seriously thank you a lot! |
Do you know when it s going to be released? |
@anymos It's what happens when your company uses github, your online when your working |
hahaha, awesome, was kind of used to the answer quickness on other github and that one was surprising :) keep it up that's great ! |
That s strange I still experiment the page reload despite using 6.4.1 metamask plugin. Is there something I can check on my side to see what I might doing wrong? |
As explained in the docs you need to do:
|
Arg, shame on me I shall have read more carefully your doc, as it was clearly mentionned. Regardless thank you so much for your help, it works perfectly once seting up the right flag. Thank you again! |
This is marked as bounty-worthy but when I tried to submit a PR (#6982) to "fix" the problem it was rejected saying that I should open an issue to discus the topic first. Upon searching for issues first, I came across this which basically (IIU the tags correctly) says to open a PR. Can we get some clarity on this topic? While the current Generally speaking, I really don't think that auto-refresh from the plugin should be an option, and the code should be deleted from MetaMask as it is only hurting the Ethereum ecosystem (not helping) and causing more problems the longer it continues to exist (like users above who didn't know they had to tell MetaMask to not do the silly and unexpected thing). |
Thanks for re-opening this discussion. Making breaking changes is a touchy matter, but we agree that this change needs to be made. We'll propose a final rollout strategy early next week, not trying to push breaking changes to the ecosystem on a Friday afternoon. |
To be clear, I would be satisfied with just about any "plan" that results in the eventual removal of this flag. Opening a PR and commenting on this issue is an attempt to get a plan into place, but if that plan is "we'll start warning people in 1 month and then in 6 months we'll invert the default and in 1 year we'll remove the flag" then I'm satisfied. |
Is there an event/subscription model for network/ account change? |
Yes, we've had an alternative network change event available for a while now, so we are nicely prepared for a transition: |
We are soon removing the automatic refresh on network change behavior. A warning has been added to ensure sites know about this upcoming change. Any site that calls `.enable` is advised to use a `networkChanged` event handler to reload manually if they rely upon that behavior. They are also advised to set the flag `autoRefreshOnNetworkChange` to `false` to opt-out of the reload behavior early. This warning might be irritating for certain sites, as they might be indifferent to whether or not the site reloads, and not eager to set a flag to opt-in early just to silence the warning. However there was no other obvious way to warning the right people about this change, as any warning prior to an actual reload would only be seen by the few people that set their browser console to preserve logs. Relates to MetaMask#3599
Expected behavior: Chain change in MM UI should not trigger a whole refresh of the browser page.
I experience this in Chrome AND firefox, with my react application.
Any input on this ?
Many thanks
The text was updated successfully, but these errors were encountered: