feat(remote): end a remote session when its client is gone

This commit is contained in:
imSp4rky
2026-11-30 17:23:35 -07:00
parent e813737506
commit ffe812f054
13 changed files with 747 additions and 53 deletions
+4 -5
View File
@@ -8,6 +8,8 @@ import threading
from typing import Any
import pytest
from aiohttp import WSMessage
from aiohttp.http_websocket import WS_CLOSED_MESSAGE
from tests.remote.unit.test_tunnel import wait_until
from unshackle.core.api.input_bridge import InputBridge
@@ -31,12 +33,9 @@ class FakeSocket:
self.closed.set()
return True
def __aiter__(self) -> FakeSocket:
return self
async def __anext__(self) -> Any:
async def receive(self) -> WSMessage:
await self.closed.wait()
raise StopAsyncIteration
return WS_CLOSED_MESSAGE
def entry_with_logs(count: int) -> SessionEntry: