gateway: handle websocket.disconnect in receive loop
Test, Build and Push / test-gateway (push) Successful in 10s
Test, Build and Push / release (push) Skipped
Test, Build and Push / build-gateway (push) Skipped

Stops the RuntimeError spam ('Cannot call receive once a disconnect
message has been received') every time the device's watchdog reboots.
Redeployed to the tatlock-ui stack.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 02:29:10 +02:00
co-authored by Claude Fable 5
parent f156b640d8
commit 395e05343d
+2
View File
@@ -54,6 +54,8 @@ async def voice(ws: WebSocket) -> None:
try:
while True:
message = await ws.receive()
if message["type"] == "websocket.disconnect":
raise WebSocketDisconnect(message.get("code", 1000))
device["last_seen"] = _now()
if "bytes" in message and message["bytes"] is not None:
if recording: