BigOokie / skywire-wing-commander

Wing Commander is a Telegram bot written in GO designed to help the Skyfleet community manage their Skyminers
MIT License
13 stars 5 forks source link

No error reported if Discovery Server unreachable #27

Closed BigOokie closed 6 years ago

BigOokie commented 6 years ago

Describe the bug I have just detected an issue where Wing Commander is not correctly handling errors when connecting to the Discovery Server API to validate Node connectivity.

If the connection fails the last know result is used (ie a cached result). This is not ideal, but under normal conditions should not impact the function.

I will be addressing this issue ASAP and expect to push an update tonight for it (all going well).

To Reproduce Steps to reproduce the behavior:

  1. Run Wing Commander Bot
  2. Ensure connection to Discovery Server is available. Check by browsing to the Discovery Server website http://discovery.skycoin.net:8001/#/
  3. Issue the `/start' command to Wing Commander.
  4. Issue the '/status' command to force a re-check of the Discovery Server
  5. Prevent access to the Discovery Server (block it in your firewall or other method)
  6. Issue the /status command again. An error should be logged to the command terminal (if your running in interactive mode, but no notification will be sent to Telegram session. The Bot will respond with the previous data - which makes everything look fine.

Expected behavior The user should be informed that the Discovery Server was unable to be contacted and that the Bot was unable to verify connectivity of the Nodes with the Discovery server at this point in time.