fix(shell): clear stale taskbar entries on WebSocket reconnect

When weft-appd restarts, session IDs reset to 0. Without clearing,
RUNNING_APPS repopulation after reconnect would coexist with stale
entries from the previous session. Removing all weft-taskbar-app
elements on the open event ensures the taskbar reflects only the
current appd session registry.
This commit is contained in:
Marco Allegretti 2026-03-11 12:01:33 +01:00
parent 5e7675c043
commit 65a10723b3

View file

@ -256,6 +256,7 @@
ws.addEventListener('open', function () { ws.addEventListener('open', function () {
wsReconnectDelay = 1000; wsReconnectDelay = 1000;
document.querySelectorAll('weft-taskbar-app').forEach(function (el) { el.remove(); });
ws.send(JSON.stringify({ type: 'QUERY_RUNNING' })); ws.send(JSON.stringify({ type: 'QUERY_RUNNING' }));
ws.send(JSON.stringify({ type: 'QUERY_INSTALLED_APPS' })); ws.send(JSON.stringify({ type: 'QUERY_INSTALLED_APPS' }));
}); });