lncli-web icon indicating copy to clipboard operation
lncli-web copied to clipboard

Spammed with "Bad gateway" when disconnected from server

Open 4oo4 opened this issue 7 years ago • 4 comments

While messing with this, I noticed that if the server is stopped while you're browsing the page, that it will constantly outputs the "Bad gateway" error every few seconds. Is it possible to have it where it won't notify you again until you acknowledge it, and maybe have it not as frequent?

It's great to have that notification but annoying to have to click it 20+ times to get back to the page. For now I'm just refreshing as a workaround.

Cheers

4oo4 avatar Apr 29 '18 23:04 4oo4

I haven't found a proper solution to handle this particular case of failing auto-refresh requests. Do you have any suggestions to do?

mably avatar Apr 30 '18 05:04 mably

@mably I haven't had time to poke around the code to see where those notifications come from, if you point me in the right direction I can see if I can come up with anything. Otherwise, it's not a big deal since you can just refresh the page to dismiss them.

4oo4 avatar Apr 30 '18 14:04 4oo4

Mostly from each dashboard element controller, like here: https://github.com/mably/lncli-web/blob/master/public/js/controllers/lnd/listpeers.js#L35 One solution could be to disable auto-refresh in case of similar repeating errors. Don't know how it could be cleanly implemented. May be we could skip showing identical errors unless a certain delay has elapsed.

mably avatar Apr 30 '18 15:04 mably

@mably That's what I was thinking, I was also looking into see if there was any way to get a variable based on whether someone interacted with the bootbox element. Perhaps it could look at xhrStatus: Complete from the API call?

I also feel like part of the problem is that each of those controllers is firing its own HTTP error alert (since they're all called from the page), so that causes them to multiply quickly. If one controller failed a connection, it follows that the rest would too. I'm not very experienced with node but I'll keep messing with it.

selection_001

4oo4 avatar May 01 '18 00:05 4oo4