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

Closed
sulliwane opened this Issue Mar 16, 2018 · 17 comments

Comments

Projects
None yet
8 participants
@sulliwane

sulliwane commented Mar 16, 2018

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

@Zanibas

This comment has been minimized.

Show comment
Hide comment
@Zanibas

Zanibas Mar 19, 2018

Contributor

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.

Contributor

Zanibas commented Mar 19, 2018

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.

@sulliwane

This comment has been minimized.

Show comment
Hide comment
@sulliwane

sulliwane Mar 19, 2018

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!

sulliwane commented Mar 19, 2018

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!

@sulliwane

This comment has been minimized.

Show comment
Hide comment
@sulliwane

sulliwane Mar 26, 2018

Any input on this question? Thanks!

sulliwane commented Mar 26, 2018

Any input on this question? Thanks!

@lazaridiscom

This comment has been minimized.

Show comment
Hide comment
@lazaridiscom

lazaridiscom Mar 26, 2018

Contributor

@sulliwane , such "deep thought" issues sometimes slip through the radar...

@danfinlay , I was surprised myself by the page reloads. Shouldn't this be at least a goal, to avoid page-reload?

Contributor

lazaridiscom commented Mar 26, 2018

@sulliwane , such "deep thought" issues sometimes slip through the radar...

@danfinlay , I was surprised myself by the page reloads. Shouldn't this be at least a goal, to avoid page-reload?

@danfinlay

This comment has been minimized.

Show comment
Hide comment
@danfinlay

danfinlay Mar 26, 2018

Contributor

@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.

Contributor

danfinlay commented Mar 26, 2018

@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.

@danfinlay danfinlay changed the title from Why is browser page refreshing/reloading on chain switch? to Stop reloading dapps on network change Mar 26, 2018

@danfinlay danfinlay added this to the Milestone 4 milestone Mar 26, 2018

@danfinlay danfinlay modified the milestones: Sprint 04, Sprint 05 Apr 23, 2018

@sulliwane

This comment has been minimized.

Show comment
Hide comment
@sulliwane

sulliwane May 18, 2018

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.

sulliwane commented May 18, 2018

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.

@olaf89

This comment has been minimized.

Show comment
Hide comment
@olaf89

olaf89 May 18, 2018

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.

olaf89 commented May 18, 2018

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.

@danfinlay

This comment has been minimized.

Show comment
Hide comment
@danfinlay

danfinlay May 18, 2018

Contributor

Are there any cases where non-developer would switch between networks on single application?

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.

Contributor

danfinlay commented May 18, 2018

Are there any cases where non-developer would switch between networks on single application?

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.

@stefek99

This comment has been minimized.

Show comment
Hide comment
@stefek99

stefek99 Jun 1, 2018

Are there any cases where non-developer would switch between networks on single application?

Having 28 tabs open ! ! ! ! ! ! ! ! ! !

I hate when switching Metamask there is reloading app somewhere else...


EDIT / UPDATE:

It displays a popup preventing the reload:

        window.onbeforeunload = function(e) {
          var dialogText = 'Screw the MetaMask';
          e.returnValue = dialogText;
          return dialogText;
        };  

image

stefek99 commented Jun 1, 2018

Are there any cases where non-developer would switch between networks on single application?

Having 28 tabs open ! ! ! ! ! ! ! ! ! !

I hate when switching Metamask there is reloading app somewhere else...


EDIT / UPDATE:

It displays a popup preventing the reload:

        window.onbeforeunload = function(e) {
          var dialogText = 'Screw the MetaMask';
          e.returnValue = dialogText;
          return dialogText;
        };  

image

@sulliwane

This comment has been minimized.

Show comment
Hide comment
@sulliwane

sulliwane Jun 1, 2018

My sentiments exactly

sulliwane commented Jun 1, 2018

My sentiments exactly

@danfinlay

This comment has been minimized.

Show comment
Hide comment
@danfinlay

danfinlay Jun 5, 2018

Contributor

This should be simple enough to implement, and our team is already stretched thin, so I'm marking this as bounty-worthy. We may post a bounty on it soon, and welcome community contributions.

Contributor

danfinlay commented Jun 5, 2018

This should be simple enough to implement, and our team is already stretched thin, so I'm marking this as bounty-worthy. We may post a bounty on it soon, and welcome community contributions.

@stefek99

This comment has been minimized.

Show comment
Hide comment
@stefek99

stefek99 Jun 9, 2018

Another use case, happened to me 1 second ago:

  • Remix.
  • I want to deploy to Ropsten.
  • Switch network...
  • Hah!
  • Back in a day, I was thinking Remix needs refreshing for some reason.
  • Now I know it is Metamask behavior.
  • No reload required...

stefek99 commented Jun 9, 2018

Another use case, happened to me 1 second ago:

  • Remix.
  • I want to deploy to Ropsten.
  • Switch network...
  • Hah!
  • Back in a day, I was thinking Remix needs refreshing for some reason.
  • Now I know it is Metamask behavior.
  • No reload required...
@sulliwane

This comment has been minimized.

Show comment
Hide comment
@sulliwane

sulliwane Jul 18, 2018

I believe this issue is still not resolved. I have latest version of MM plugin, but still always reloading.

sulliwane commented Jul 18, 2018

I believe this issue is still not resolved. I have latest version of MM plugin, but still always reloading.

@bdresser

This comment has been minimized.

Show comment
Hide comment
@bdresser

bdresser Jul 18, 2018

Member

@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!

Member

bdresser commented Jul 18, 2018

@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!

@sulliwane

This comment has been minimized.

Show comment
Hide comment
@sulliwane

sulliwane Jul 26, 2018

@bdresser got it, thank you

sulliwane commented Jul 26, 2018

@bdresser got it, thank you

@Lucas1313

This comment has been minimized.

Show comment
Hide comment
@Lucas1313

Lucas1313 Sep 18, 2018

It seem that this is still happening in the new Beta version
image
This is really annoying as it breaks our flow!
Is there a solution to that problem soon?

Lucas1313 commented Sep 18, 2018

It seem that this is still happening in the new Beta version
image
This is really annoying as it breaks our flow!
Is there a solution to that problem soon?

@bdresser

This comment has been minimized.

Show comment
Hide comment
@bdresser

bdresser Sep 19, 2018

Member

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!

Member

bdresser commented Sep 19, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment