Closed balloob closed 4 years ago
Also happens on non-default Lovelace dashboards in panel disconnect
In this case unsubscribing is actually not necessary, we will resub automatically on reconnect. But the panel doesn't know that, it just knows it's being disconnected and should not use resources.
I am going to make this logic opt-in, mark it experimental while we figure out the bugs.
Profile panel had one too.
One thing that we can explore is that if a connection is suspended, we want to hold onto all messages that are in flight? However, that is also dangerous as that can queue up a lot of requests !
Maybe if we know that we're soon going to reconnect the WS connection, we can enable "queueIfDisconnected" setting, and then disable that after we're connected again. We would put that in home-assistant.ts
.
Checklist
The problem
When we are away from the tab for 5 minutes, we disconnect the panel from the DOM and disconnect the websocket connection.
When we navigate back to the tab, we will reconnect the panel to the DOM and re-open the connection.
Reconnecting the panel to the DOM will trigger
connectedCallback
, which in the case of<hui-image>
can involve getting a signed path to be able to show a preview of a camera. This request fails withWebSocket is already in CLOSING or CLOSED state.
Expected behavior
Steps to reproduce
Load demo integration, leave tab hidden for 5 minutes, navigate back.
Environment
State of relevant entities
Problem-relevant configuration
Javascript errors shown in your browser console/inspector
Additional information