bitcoin-core / gui-qml

Bitcoin GUI (experimental QML-based fork)
MIT License
111 stars 40 forks source link

Put BlockClock into an error state if node init fails #383

Closed johnny9 closed 4 weeks ago

johnny9 commented 9 months ago

Initial step for adding error states to the NodeRunner

Link to github actions build artifacts.

[Build Artifacts]()

johnny9 commented 9 months ago

Tested by starting up a pruned testnet node and then changing the prune settings

Screenshot from 2023-12-19 20-37-07

johnny9 commented 9 months ago

nit: would it be easy to remove HandCursor wh

Yeah I noticed that as well. Should probably do that until the pop up view with the details is sorted out.

GBKS commented 8 months ago

We have some mock-ups for different error types in the design docs (half-way down the page). Ideally, we can always know what the problem was and show a respective icon & message. Maybe not exactly, but the general error source is already helpful.

For errors that cannot be recognized, the mock-ups show "Error" and "Tap for details". If we want to go this route, we need to figure out what is shown when tapping. A full screen with a proper explanation, error log, tips to resolve, etc, like here?

johnny9 commented 8 months ago

Concept ACK

Is it possible to add some small text/ description within the BlockClock? Like what kind of error... "init"? With a tooltip perhaps to show an extended description. As in the brainstorming issue #348 where you can see "No Wifi" within the "Paused" BlockClock state.

This is ultimately the goal. In this PR, I've just implemented the portion that I'm certain about and would likely want to follow up afterwards with the description/details portion.

We have some mock-ups for different error types in the design docs (half-way down the page). Ideally, we can always know what the problem was and show a respective icon & message. Maybe not exactly, but the general error source is already helpful.

For errors that cannot be recognized, the mock-ups show "Error" and "Tap for details". If we want to go this route, we need to figure out what is shown when tapping. A full screen with a proper explanation, error log, tips to resolve, etc, like here?

What to show when tapping is what I'm uncertain about at the moment and was feeling like it might be a chance for me to pretend to be a designer a bit and play with figma. The mobile design looked good and just need to get a basic design for the Desktop.

johnny9 commented 8 months ago

Update from 03a8725 to 2b61d22

johnny9 commented 8 months ago

I've 2 issues running bitcoin-qt with this change:

  1. As soon the app starts up I got these 2 errors regarding qml components
QVariant::load: unknown user type with name BitcoinUnits::Unit.
Running initialization in thread
qrc:/qml/components/BlockClock.qml:33:5: Unable to assign [undefined] to QString

I removed the invalid property in the latest update which resolved that error

  1. After the above, since I got an instance on a pruned node with some corrupted index (due to some break during loadtxoutset) and bitcoin.conf still referencing blockfilterindex=1 and coinstatsindex=1. So, when I remove those indexing settings I got what @MarnixCroes described above -> "infinite loading on master". Should I not get the error icon also in this case? How I can validate this change? @johnny9 could you please add repro instructions on the description? Complete terminal error logs

This won't catch all errors and there will need to be an effort to categorize all of these possible error states as well as render a description of what happened to the user.

This change triggers when void NodeModel::initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info) callback has success = false as a parameter. The specific case I use to test is to start up a signet node with prune=1907 (the default you get with our onboarding flow). Then after it syncs a bit, I remove the prune option in my settings.json and restart the app.

GBKS commented 8 months ago

Related, but probably not essential to this PR, here's an idea for handling errors. So on the left, we have this old mock-up for a tooltip that appears when hovering the peers dots, to give you slightly more info about connectivity. Clicking would take you to the peers page.

Now, we can take a similar approach to errors. Based on the type of error, a click can either show the tooltip or take you to the page relevant to this error (the page then needs to show appropriate information).

What do you make of this pattern?

image

GBKS commented 6 months ago

Please restart with -reindex or -reindex-chainstate to recover.

Is there a way to automatically restart with these options so the user can just click a button?

MarnixCroes commented 1 month ago

Please restart with -reindex or -reindex-chainstate to recover.

Is there a way to automatically restart with these options so the user can just click a button?

it's possible, best would be to do it as a follow up imo