From 8c2ea95723e8a1077f062f6134d3bd0a4eaaedcd Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Thu, 7 May 2026 13:39:40 +0300 Subject: [PATCH] fix: account for proxy pipeline latency in switch overlay duration Add 4s for the WS-to-Belkin-to-Avocent pipeline delay before the key sequence starts executing, plus 1s settle time after for the video stream to stabilize. Total overlay = 4s + (pauses * pause_duration) + 1s. [deploy: frontend] Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/ericrfb-frontend/src/pages/console.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ericrfb-frontend/src/pages/console.ts b/crates/ericrfb-frontend/src/pages/console.ts index 07bcbb1..7c5f7e7 100644 --- a/crates/ericrfb-frontend/src/pages/console.ts +++ b/crates/ericrfb-frontend/src/pages/console.ts @@ -199,9 +199,11 @@ function switchToPort(port: number) { const hotkey = portHotkeys[port] if (!hotkey || ws?.readyState !== WebSocket.OPEN) return - // Count pause tokens to calculate total switch duration + // Total duration: proxy round-trip + key sequence execution + settle time const pauseCount = (hotkey.match(/\*/g) || []).length - const duration = Math.max((pauseCount * keyPauseDuration) + 500, 1000) + const proxyLatency = 4000 // WS → proxy → Belkin → Avocent pipeline delay + const settleTime = 1000 // wait for video stream to stabilize after switch + const duration = proxyLatency + (pauseCount * keyPauseDuration) + settleTime // Suspend input and show overlay inputSuspended = true