umbrel-dashboard
umbrel-dashboard copied to clipboard
Balance USD amount sometimes display ~ $NaN
I will fix this later, I am just documenting my findings here for later reference.
That is a known issue : the price is fetched via Tor. We talked about this in the Keybase dev chat with @lukechilds. Sometimes the request is refused by the API, and the price is not fetched until Tor changes its route (every ~10 min).
A workaround could be to save the last fetched price and return it in case of a request error.
Yes, that would be a great workaround. Where do you suggest this hardening code should be, dashboard (client-side) or where we make the call to the API (server-side)? It can easily be done on the client side. Just not sure on your guyses philosophy on server vs client-side code (but ill get there).
I can always not display the amount it if it's not a number as another workaround?
Here is the scheme to get the price:
Dashboard --API--> Manager --API via Tor--> Cryptocompare
I think the best way to do it could be to have the manager save the price when it is successfully retrieved. So when the request is unsuccessful (for example because of the tor current identity), the manager returns the saved price to the dashboard instead of nothing.
Yea that sounds great.
Here is the route: https://github.com/getumbrel/umbrel-manager/blob/master/routes/v1/external.js
Yes that's exactly the place to put the fix. I'll make a PR later tonight.
@louneskmt I have created a PR as promised. https://github.com/getumbrel/umbrel-manager/pull/62
Any plans merging this?
I hope so. poke @mayankchhabra @louneskmt
Sorry for the delay, missed this, reviewed your PR @rubenhbaca!
@lukechilds thank you, I will review and make those changes tonight.
@rubenhbaca Any plans to finish the PR for this bug? If not, I would be happy to work on this issue. Thanks!
@TannerR1776 i will review this PR tonight and see if there is any further changes and pump luke for a merge.