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

node connection settings #24

Merged
merged 15 commits into from
Nov 4, 2023
Merged

Conversation

octobocto
Copy link
Collaborator

@octobocto octobocto commented Nov 3, 2023

Note that this PR does not persist anything between launches, and changes to the config
settings apply only for the current session.

RPC connections can fail at any time, and before we can implement a nice guide on startup, we need a way to guide them if it fails after they have launched the app.

This implements that UX, with a nice chip in the dashboard indicating connection status. The chip will update when the rpc connection changes.

Screenshot 2023-11-03 at 15 09 20

@octobocto octobocto force-pushed the 2023-11-03-node-connection-settings branch 2 times, most recently from 493bed8 to 6aea2fd Compare November 3, 2023 17:01
@octobocto octobocto force-pushed the 2023-11-03-node-connection-settings branch from 6aea2fd to 070cf4f Compare November 4, 2023 04:15
@octobocto octobocto linked an issue Nov 4, 2023 that may be closed by this pull request
Copy link
Collaborator

@torkelrogstad torkelrogstad left a comment

Choose a reason for hiding this comment

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

Very good stuff! This is untested from my part btw, should prob do that before we merge

lib/rpc/rpc.dart Outdated Show resolved Hide resolved
lib/rpc/rpc_mainchain.dart Outdated Show resolved Hide resolved
lib/rpc/rpc_mainchain.dart Outdated Show resolved Hide resolved
lib/rpc/rpc_sidechain.dart Outdated Show resolved Hide resolved
lib/pages/tabs/settings_tab.dart Show resolved Hide resolved
lib/pages/tabs/settings_tab.dart Outdated Show resolved Hide resolved
lib/pages/tabs/settings_tab.dart Outdated Show resolved Hide resolved
lib/pages/tabs/settings_tab.dart Outdated Show resolved Hide resolved
lib/pages/tabs/settings_tab.dart Outdated Show resolved Hide resolved
lib/rpc/rpc_sidechain.dart Outdated Show resolved Hide resolved
@octobocto octobocto force-pushed the 2023-11-03-node-connection-settings branch from 00f775d to 1c91922 Compare November 4, 2023 10:05
It's purpose is to have a universal way to create clients,
and keep track of current connection settings.

A side effect is that we read config files inside each rpc,
and failing initialization doesn't crash the entire app.

Reasoning behind not crashing on startup is that an rpc
connection can fail at any time, and sidesail should know
immediately when a connection is bad! The user might shut
down their node, it might crash etc. Sidesail will probably
stay open for days at a time. Most people rarely close their
applications.

It's a bit messy right now, hoping to make it cleaner in a later
iteration.
@octobocto octobocto force-pushed the 2023-11-03-node-connection-settings branch from 1c91922 to d06a4a5 Compare November 4, 2023 10:09
@octobocto
Copy link
Collaborator Author

All fixed now

@torkelrogstad
Copy link
Collaborator

image

Looks a bit strange when the connection chips places themselves over other data, IMO. Would it be an idea to place them at the bottom of the side nav bar?

@torkelrogstad
Copy link
Collaborator

Very nice!

image

@torkelrogstad
Copy link
Collaborator

Could we make it such that pressing the connection chips navigates to the settings page?

@octobocto
Copy link
Collaborator Author

Could we make it such that pressing the connection chips navigates to the settings page?

That's the part I don't know how to do just yet

@torkelrogstad
Copy link
Collaborator

image

Could we display a better message here? "Unable to connect to the node: "

@torkelrogstad
Copy link
Collaborator

That's the part I don't know how to do just yet

Right, OK. For later!

@torkelrogstad
Copy link
Collaborator

image

This is also a failure case we should pick up, incorrect host

@torkelrogstad
Copy link
Collaborator

Verify in the input fields that something is entered?
image

@torkelrogstad
Copy link
Collaborator

"Reset to config file values" button does nothing?

@torkelrogstad
Copy link
Collaborator

And when I enter an invalid conf path, nothing happens as well. Would expect something like "file not found"

@octobocto
Copy link
Collaborator Author

"Reset to config file values" button does nothing?

No, will fix it in the PR that comes together with persisting custom values to disk

@octobocto
Copy link
Collaborator Author

And when I enter an invalid conf path, nothing happens as well. Would expect something like "file not found"

That's strange, will have to look more at that

@octobocto
Copy link
Collaborator Author

image Could we display a better message here? "Unable to connect to the node: "

strikes me as a tad bit overkill to add that prefix. the large red glowing globe gives enough context to understand it's an error message imo

@torkelrogstad
Copy link
Collaborator

strikes me as a tad bit overkill to add that prefix. the large red glowing globe gives enough context to understand it's an error message imo

Was more thinking that we should present it as "Unable to connect to the node: Connection refused", and strip away the SocketException stuff. Basically unwrap to the innermost error message, and just display that

@torkelrogstad torkelrogstad merged commit 1e2bf1b into master Nov 4, 2023
1 check passed
@torkelrogstad torkelrogstad deleted the 2023-11-03-node-connection-settings branch November 4, 2023 11:27
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.

TX list should scroll on overflow
2 participants