cryptosharks131 / lndg

Lite GUI web interface to analyze lnd data and leverage the backend database for automation tools around rebalancing and other basic maintenance tasks.
MIT License
219 stars 41 forks source link

GUI not displaying forwards #358

Closed microlancer closed 9 months ago

microlancer commented 9 months ago

My /forwards page is blank.

I inspected the page with Chrome Dev Tools and saw:

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'default')
    at Object.chan_in_alias (forwards:24:58)
    at Object.render (helpers.js:54:41)
    at build_routed (forwards:122:50)
    at HTMLDocument.<anonymous> (forwards:104:5)

Screenshot from 2023-12-22 15-55-16

In the network tab, I see the fetch http://localhost:8889/api/forwards/?limit=50&format=json and it is returning a successful list of JSON containing all the forwards.

So the data is there, but the JS is failing and so the page is blank.

Any ideas?

microlancer commented 9 months ago

Here is some more added context. The line where it's crashing is this missing value.

Screenshot from 2023-12-22 16-00-32

chan_in_alias or chan_out_alias are sometimes blank

microlancer commented 9 months ago

From what I can tell, they are blank when the channel was closed and no longer exists and LND can't look up the name anymore.

microlancer commented 9 months ago

If anyone is having issues, it's a pretty easy fix, just update these two lines in gui/templates/base.html:

      "chan_in_alias": f => ({innerHTML: f.chan_in_alias != null ? f.chan_in_alias.default(f.chan_id_in) : ''}),
      "chan_out_alias": f => ({innerHTML: f.chan_out_alias != null ? f.chan_out_alias.default(f.chan_id_out) : ''}),

And the page should load forwards again.

Also, a good thing to keep in mind is that the forwards are loaded slowly from LND over time and many background job requests, so they might start off showing only very old forwards.

A good UI improvement would be to have some indicator that the data loading is still in progress.

cryptosharks131 commented 9 months ago

Please try the fix that was deployed in the v1.8.0 branch. "chan_in_alias": f => ({innerHTML: f.chan_in_alias || f.chan_id_in}), "chan_out_alias": f => ({innerHTML: f.chan_out_alias || f.chan_id_out}),

microlancer commented 9 months ago

Please try the fix that was deployed in the v1.8.0 branch. "chan_in_alias": f => ({innerHTML: f.chan_in_alias || f.chan_id_in}), "chan_out_alias": f => ({innerHTML: f.chan_out_alias || f.chan_id_out}),

It works for me!