N3developertoolkit / neo3-visual-tracker

Neo N3 blockchain explorer that is directly available within Visual Studio Code for developer usage and development scenarios.
https://marketplace.visualstudio.com/items?itemName=ngd-seattle.neo3-visual-tracker
MIT License
7 stars 11 forks source link

[UX] blockchain explorer silently "hangs" if no chain is running #129

Open ixje opened 2 years ago

ixje commented 2 years ago

Opening the block chain explorer while the chain is not running gives the following screen image The Loading... message suggests it's trying to do something while in reality it will hang there indefinitely. I think the screen should give a different view when the chain is not running or becomes non-responsive.

robliou commented 2 years ago

I wasn’t able to recreate this error. When I tried, the blockchain explorer opened just fine for me…?

ixje commented 2 years ago

The tab opens fine, that’s not the issue. The point is if you have not started a network, then it will open a tab and hang pretending to load block data. It will never complete because in the background it is trying to communicate to a network that is not running and can therefore never fetch the data it is trying to display

On 27 May 2022, at 16:43, Rob L. @.***> wrote:

 I wasn’t able to recreate this error. When I tried, the blockchain explorer opened just fine for me…?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

robliou commented 2 years ago

Weird. I think I may have encountered that error before. However, I just tried again but again, wasn't able to recreate the issue. For the record, I made sure that I was not connected to any blockchain, and then tried opening the blockchain explorer for 0-N3 Mainnet, 1-N3 TestNet, and 3-Single-Node.Neo-Express. All worked OK (see screenshot below). Note that I can't connect to the other two blockchains, so connecting to the blockchain explorer for them would be a moot point..

A6

ixje commented 2 years ago

Mainnet and Testnet are expected to always work (assuming internet connectivity) because they're always online. The single-node is working because from the Terminal tab at the bottom I can see the chain is running (the name this terminal belongs to is also displayed at the far right (same height as the Terminal tab) and confirms it is the single node.neo-express that is running. If you press the trash bin icon on the far right while having this terminal open, then close the block chain explorer tab and re-open the explorer it should fail. Here's a video displaying the issue

https://user-images.githubusercontent.com/6625537/170931105-be80fb45-d60f-40d9-8753-0725d100baf7.mp4

I think what the above really shows is that this "Neo: Not connected" status bar at the bottom is not what we think it is. If it should represent which chain is running, then it is malfunctioning. If it should represent something else, then whatever it is supposed to be it is not clear and leads to confusion.

ixje commented 2 years ago

So what I'm trying to suggest with the original issue is to probably look here https://github.com/ngdenterprise/neo3-visual-tracker/blob/b50ab36f58d98497b4d2e2989937ba7dcbf677a1/src/extension/panelControllers/trackerPanelController.ts#L53

then when blockchainMonitor.state.isHealthy is false display some other panel. isHealthy is controlled here https://github.com/ngdenterprise/neo3-visual-tracker/blob/b50ab36f58d98497b4d2e2989937ba7dcbf677a1/src/extension/blockchainMonitor/blockchainMonitorInternal.ts#L262-L267 if we can't get the blockcount (which is also an RPC command) then we can't get any blocks either and there should probably be some logic added there that doesn't try to fetch any blocks while we know it is going to fail anyway.

The following screenshot shows that we're failing to connect to the RPC node and that's why we hang indefinitely

image