more fixes for plugins

This commit is contained in:
KingKDot
2026-04-03 09:30:58 -05:00
parent d82370362f
commit 3a349b0608
3 changed files with 8 additions and 0 deletions
+1
View File
@@ -530,6 +530,7 @@ async function startServer() {
sendHVNCCommand,
notifyConsoleClosed,
clearPendingNotificationScreenshots: notificationPluginHandlers.clearPendingNotificationScreenshots,
clearClientPluginState: notificationPluginHandlers.clearClientPluginState,
notifyRemoteDesktopStatus,
handleBuildTagConnection,
notifyDashboard: sessionManager.notifyDashboardViewers,
@@ -85,6 +85,7 @@ type WsLifecycleDeps = {
sendHVNCCommand: (target: ClientInfo, commandType: string, payload: Record<string, unknown>) => 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}`);
@@ -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;
},