From 3a349b0608aa70e07897d5e2a06a988c081a603a Mon Sep 17 00:00:00 2001 From: KingKDot Date: Fri, 3 Apr 2026 09:30:58 -0500 Subject: [PATCH] more fixes for plugins --- Overlord-Server/src/main-server.ts | 1 + .../src/server/routes/websocket-lifecycle-routes.ts | 2 ++ Overlord-Server/src/server/ws-notifications-plugin.ts | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/Overlord-Server/src/main-server.ts b/Overlord-Server/src/main-server.ts index 9b18423..e3cf72e 100644 --- a/Overlord-Server/src/main-server.ts +++ b/Overlord-Server/src/main-server.ts @@ -530,6 +530,7 @@ async function startServer() { sendHVNCCommand, notifyConsoleClosed, clearPendingNotificationScreenshots: notificationPluginHandlers.clearPendingNotificationScreenshots, + clearClientPluginState: notificationPluginHandlers.clearClientPluginState, notifyRemoteDesktopStatus, handleBuildTagConnection, notifyDashboard: sessionManager.notifyDashboardViewers, diff --git a/Overlord-Server/src/server/routes/websocket-lifecycle-routes.ts b/Overlord-Server/src/server/routes/websocket-lifecycle-routes.ts index 6737ec2..ff42802 100644 --- a/Overlord-Server/src/server/routes/websocket-lifecycle-routes.ts +++ b/Overlord-Server/src/server/routes/websocket-lifecycle-routes.ts @@ -85,6 +85,7 @@ type WsLifecycleDeps = { sendHVNCCommand: (target: ClientInfo, commandType: string, payload: Record) => void; notifyConsoleClosed: (clientId: string, reason: string) => void; clearPendingNotificationScreenshots: (clientId: string) => void; + clearClientPluginState: (clientId: string) => void; notifyRemoteDesktopStatus: (clientId: string, status: string, reason?: string) => void; handleBuildTagConnection: (clientId: string, buildTag: string) => void; notifyDashboard: () => void; @@ -714,6 +715,7 @@ export function handleWebSocketClose( deps.notifyConsoleClosed(clientId, "Client disconnected"); setOnlineState(clientId, false); deps.clearPendingNotificationScreenshots(clientId); + deps.clearClientPluginState(clientId); deps.notifyDashboard(); logger.info(`[close] ${clientId} code=${code} reason=${reason}`); diff --git a/Overlord-Server/src/server/ws-notifications-plugin.ts b/Overlord-Server/src/server/ws-notifications-plugin.ts index 361069b..d98790a 100644 --- a/Overlord-Server/src/server/ws-notifications-plugin.ts +++ b/Overlord-Server/src/server/ws-notifications-plugin.ts @@ -358,6 +358,11 @@ export function createNotificationPluginHandlers(deps: CreateDeps) { markPluginLoaded, + clearClientPluginState(clientId: string) { + deps.pluginLoadedByClient.delete(clientId); + deps.pluginLoadingByClient.delete(clientId); + }, + isPluginLoaded(clientId: string, pluginId: string): boolean { return deps.pluginLoadedByClient.get(clientId)?.has(pluginId) ?? false; },