Skip to content

Log Viewer: Implement keep alive mechanism for WS #3569

@florian-h05

Description

@florian-h05

According to openhab/openhab-core#5165, the log viewer needs some type of keep alive handling for the WebSocket:

What exactly is needed there? What should the UI send?

I can't quite answer that, but usually when you make a heartbeat functionality, you want to use it for something. As it is now, MainUI sends them but never checks if they make it. Core just accepts them without doing anything as well. They might be intended to prevent the socket from timing out, but normally I'd expect that they should have some "meaning" in themselves.

One option I could see is that they could be used to indicate if the log viewer is "connected" - if failed heartbeats were caught, it could be used to set a status that's visible to the user, so that the user knows that the log isn't "online". Another option could be that if a heartbeat fails, an attempt is made to set up a new connection, perhaps on a timer, combined with some kind of online/offline indication.

As they are now, they seem quite pointless, and I also think that it's a problem that you can't really see if the log is "connected" or not - because it certainly has a tendency to "lose connection", and you have no way to know if no new entries arrive because the connection has been lost or because no loggable events have taken place. You can't reload the page "to make sure that you're connected" either, because if you do that, you lose all history except the last 100 entries (which is "nothing"). To me, the fact that you don't know it does receive log entries or not, is one of the things that make the log viewer a very poor replacement for Frontail (the lack of history is the biggest one though).

Originally posted by @Nadahar in openhab/openhab-core#5165 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions