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

Add warning about reload on network change #7047

Merged
merged 1 commit into from
Aug 21, 2019

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Aug 21, 2019

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 either add a networkChanged event handler to reload manually, or 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 #3599

whymarrh
whymarrh previously approved these changes Aug 21, 2019
Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

Seems legit to me, we could get this into 7.1.0.

danfinlay
danfinlay previously approved these changes Aug 21, 2019
Copy link
Contributor

@danfinlay danfinlay left a comment

Choose a reason for hiding this comment

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

Looks good overall, I have one piece of possible feedback that you might want to make a change based on.

app/scripts/inpage.js Outdated Show resolved Hide resolved
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
@Gudahtt Gudahtt dismissed stale reviews from danfinlay and whymarrh via 2ceac1f August 21, 2019 17:31
@Gudahtt Gudahtt force-pushed the auto-reload-deprecation-warning branch from 1db13d1 to 2ceac1f Compare August 21, 2019 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants