Closed Sian-Lee-SA closed 8 months ago
What do you mean by removed from the DOM ? Changing tabs ? removing the card ? Do you have an example when it occurs ?
there reload of the history is triggered when HA frontend call the shouldUpdate method (there is no api call if HA do not call this method ...
Could be a condition card or dialog... I noticed the action handlers don't have disconnected callbacks.
EDIT: I haven't reviewed the code thoroughly but that's probably where it's happening. This in retrospect would keep the element alive.
Also the terminlogy of removing from the DOM means it no longer exists in the document
Network tab on browser shows the calls continue even when navigating away to any page. The only way to stop is refreshing the browser
I don't reproduce the issue when changing tab or page ...
Version 2.1.1 should resolve the issue. Data refreshing is now based on lit element lifecycle events 'connectedCallback' and 'disconnectedCallback'
This card is still calling api history after it has been removed. Seems you're not handling disconnected callbacks and stopping event listeners which is keeping the element alive.