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

Brand-new network selection screen and a lot of refactoring #851

Merged
merged 5 commits into from Jan 26, 2022

Conversation

brusherru
Copy link
Member

@brusherru brusherru commented Jan 8, 2022

It closes #837 and fixes #822

Also, in case if User opens a wallet and the network does not exist on the discovery service — the app will ask the User to switch the network.
The same behavior will be triggered in case if network disappeared from the discovery service (not sure do we need to do that or not), this check happens every 5 minutes.


About refactoring.

In common, it decouples initialization of Managers (Node, Smesher, Wallet) and some event handlers from the requirement of prefetch data, that can't be prefetched since the user didn't select a network yet. In other words, now Smapp may start without knowledge about any available network, and therefore may start Node and GRPC clients much later.

To reach this goal I had to:

  1. Introduces context in the main process. So now different parts of the system may be less coupled with others but have a shared "state" (in the simplest version which mutates an object by reference).
  2. Make things work fine without a very special order of function calls
  3. Pull out some event handlers from WalletManager, so WalletManager becomes in common the same mediator between client and GRPC Services, as others.
  4. Refactor fetching networks, node config, public APIs, and stuff related to this

I believe that these changes will make the app more stable (unknown network / disconnected now is an expected state of the App), and more maintainable since we decoupled a lot of parts of the whole system.

IPC subscriptions, invokers, and types should be refactored further. But probably within another PR.

@brusherru brusherru requested a review from avive January 8, 2022 00:07
@brusherru brusherru self-assigned this Jan 8, 2022
@github-actions

This comment has been minimized.

@brusherru brusherru changed the title Brand-new network selection screen and a lot of refactoring (WIP) Brand-new network selection screen and a lot of refactoring Jan 11, 2022
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@brusherru brusherru force-pushed the refactoring-main-process branch 2 times, most recently from 52275c3 to af48d4c Compare January 13, 2022 12:37
@brusherru brusherru merged commit be6282b into develop Jan 26, 2022
@brusherru brusherru deleted the refactoring-main-process branch January 26, 2022 13:57
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.

Add network selection to new wallet+node flow Handle errors of fetching discovery and network configs
1 participant