From 00e6edbfa8541a3213b14f2f114a4adbf2145f66 Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 10 Oct 2025 22:15:44 +0300 Subject: [PATCH] fix: prevent infinite getLocalVersion RPC calls on refresh The getLocalVersion useEffect had getLocalVersion and hasPermission in its dependency array. Since these functions are recreated on every render, this caused an infinite loop of RPC calls when refreshing the primary session, resulting in 100+ identical getLocalVersion requests. Fix: Remove function references from dependency array, only keep appVersion which is the actual data dependency. The effect now only runs once when appVersion changes from null to a value. This is the same pattern as the previous fix for getVideoState, getKeyboardLedState, and getKeyDownState. --- ui/src/routes/devices.$id.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/routes/devices.$id.tsx b/ui/src/routes/devices.$id.tsx index cf82ad0a..3962f1b5 100644 --- a/ui/src/routes/devices.$id.tsx +++ b/ui/src/routes/devices.$id.tsx @@ -898,7 +898,8 @@ export default function KvmIdRoute() { if (!hasPermission(Permission.VIDEO_VIEW)) return; getLocalVersion(); - }, [appVersion, getLocalVersion, hasPermission]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [appVersion]); const ConnectionStatusElement = useMemo(() => { const hasConnectionFailed =