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

switching mainnet and testnet is mismatched - closes #2030 #2346

Merged

Conversation

@osvaldovega
Copy link
Contributor

commented Aug 13, 2019

What issue have I solved?

-- #2030

How have I implemented/fixed it?

The solution consists in check in the settings if the network switcher is on or off and based on that at the time of logout update the settings to switch to Mainnet in case the actual network is Testnet or Custom Node.

So in other words.

  1. If network switcher is off the current network is Mainnet in this case there is nothing to change.
  2. If network switcher is on and current network is Mainnet in this case there is nothing to change.
  3. If network switcher is on and current network is Testnet or Custom Node, in this case there is nothing to change.
  4. If network switcher is on and current network is Testnet or Custom Node, and use login and from settings page disable (OFF) the network switcher, then when he logout the code check this and if actual network it is different from Mainnet and network switcher if OFF then update the settings and network to default on (Mainnet).

How has this been tested?

  1. Sign-in to TestNet
  2. Go o Setting
  3. Disabled network switcher.
  4. Logout
  5. Sign-in again
  6. Actual network should be Mainnet

Review checklist

@osvaldovega osvaldovega added this to the Sprint 7 milestone Aug 13, 2019

@osvaldovega osvaldovega self-assigned this Aug 13, 2019

@osvaldovega osvaldovega added this to Pull Requests in Version 1.20.0 via automation Aug 13, 2019

@massao
Copy link
Contributor

left a comment

Looks good . 👍

@massao massao requested a review from Efefefef Aug 13, 2019

@reyraa reyraa removed this from Pull Requests in Version 1.20.0 Aug 13, 2019

@reyraa reyraa added this to Pull Requests in Version 1.21.0 via automation Aug 13, 2019

@Efefefef
Copy link
Contributor

left a comment

🐛 How about 'Explore as a guest'? It seems logical to have the same behaviour, but right now if we disable the network switcher, it logs into the last used, no to the mainnet

@osvaldovega

This comment has been minimized.

Copy link
Contributor Author

commented Aug 13, 2019

good catch @Efefefef I just made the change. You can check it again

@Efefefef

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

🐛 The network is changed to Mainnet right after logging out if you switched off the network switcher
Do you think it is the right thing to do? I may want to stay in the last used network. It is not said anything about implicitly changing your network: 'Enable a network switcher that lets you select testnet or custom node when logging in.'

Another thing: If you turn off the network switcher and reload the app the network stays the same. It is contrary to the logic described above. What should happen in that case?

I don't like the idea of this ticket in the first place, so please let @reyraa decide

Changing the network implicitly for the user/changing this network choice behaviour will make users who once enabled network switcher always have it enabled because they will not be sure which network they are connected to

@osvaldovega

This comment has been minimized.

Copy link
Contributor Author

commented Aug 14, 2019

Hey @Efefefef I just update the PR, I made the fix based on your comments... in other hand well yes the idea is that if there is no network switcher active then the app should be working only with Mainnet expect when you are logged, then after logout this should change to Mainnet, so in summary works like this.

  • If network switcher is ON the application will use in everywhere the network selected by the user, so if the user refresh the app logout and log in again, go to explore as a guest.

  • If network switcher is OFF then app will use the Mainnet network in everywhere.

  • If user login with a network different from Mainnet (Testnet or Custom Node) and disabled the Network switcher he can CONTINUE using the same network while navigate as a logged in user, IF refresh or logout the network will be switch to Mainnet.

Hope this help to clarify.

@Efefefef

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

Cool! Now its consistent with new logic

@Efefefef Efefefef added the ready label Aug 14, 2019

@osvaldovega osvaldovega merged commit 8d106f5 into development Aug 14, 2019

3 checks passed

Jenkins e2e tests e2e tests passed
Details
Jenkins test deployment Commit was deployed to test
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details

Version 1.21.0 automation moved this from Pull Requests to Merged Pull Requests Aug 14, 2019

@osvaldovega osvaldovega deleted the 2030-switching-mainnet-and-testnet-is-mismatched branch Aug 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.