fix: add pong/timeout detection to prevent silent connection hangs
Deploy Dashboard (Dev) / deploy-dev (push) Successful in 2m2s
Deploy Dashboard (Dev) / deploy-dev (push) Successful in 2m2s
- Backend now responds to __ping__ with __pong__ - Frontend detects missing pong within 5s and closes connection - This triggers proper reconnect/auth recovery instead of hanging - Fixes 'keepalive ping timeout' issue where connection appears alive but is dead
This commit is contained in:
@@ -180,6 +180,7 @@ async def ws_endpoint(websocket: WebSocket, host: str = Query("nas"), token: str
|
||||
process.stdin.write(data)
|
||||
elif "text" in msg and msg["text"]:
|
||||
if msg["text"] == "__ping__":
|
||||
await websocket.send_text("__pong__")
|
||||
continue
|
||||
process.stdin.write(msg["text"].encode())
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user