style: add debug logging to ws relay exceptions; format test_frontend_css
This commit is contained in:
+12
-12
@@ -677,8 +677,8 @@ async def terminal_ws_proxy(websocket: WebSocket) -> None:
|
|||||||
await ttyd_ws.send(msg["bytes"])
|
await ttyd_ws.send(msg["bytes"])
|
||||||
elif msg.get("text"):
|
elif msg.get("text"):
|
||||||
await ttyd_ws.send(msg["text"])
|
await ttyd_ws.send(msg["text"])
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
_log.debug("ws relay closed (client_to_ttyd): %s", exc)
|
||||||
|
|
||||||
async def ttyd_to_client() -> None:
|
async def ttyd_to_client() -> None:
|
||||||
try:
|
try:
|
||||||
@@ -687,12 +687,12 @@ async def terminal_ws_proxy(websocket: WebSocket) -> None:
|
|||||||
await websocket.send_bytes(message)
|
await websocket.send_bytes(message)
|
||||||
else:
|
else:
|
||||||
await websocket.send_text(message)
|
await websocket.send_text(message)
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
_log.debug("ws relay closed (ttyd_to_client): %s", exc)
|
||||||
|
|
||||||
await asyncio.gather(client_to_ttyd(), ttyd_to_client())
|
await asyncio.gather(client_to_ttyd(), ttyd_to_client())
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
_log.debug("ws proxy closed: %s", exc)
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
await websocket.close()
|
await websocket.close()
|
||||||
@@ -756,8 +756,8 @@ async def federation_terminal_ws_proxy(websocket: WebSocket, remote_id: int) ->
|
|||||||
await remote_ws.send(msg["bytes"])
|
await remote_ws.send(msg["bytes"])
|
||||||
elif msg.get("text"):
|
elif msg.get("text"):
|
||||||
await remote_ws.send(msg["text"])
|
await remote_ws.send(msg["text"])
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
_log.debug("federation ws relay closed (client_to_remote): %s", exc)
|
||||||
|
|
||||||
async def remote_to_client() -> None:
|
async def remote_to_client() -> None:
|
||||||
try:
|
try:
|
||||||
@@ -766,12 +766,12 @@ async def federation_terminal_ws_proxy(websocket: WebSocket, remote_id: int) ->
|
|||||||
await websocket.send_bytes(message)
|
await websocket.send_bytes(message)
|
||||||
else:
|
else:
|
||||||
await websocket.send_text(message)
|
await websocket.send_text(message)
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
_log.debug("federation ws relay closed (remote_to_client): %s", exc)
|
||||||
|
|
||||||
await asyncio.gather(client_to_remote(), remote_to_client())
|
await asyncio.gather(client_to_remote(), remote_to_client())
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
_log.debug("federation ws proxy closed: %s", exc)
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
await websocket.close()
|
await websocket.close()
|
||||||
|
|||||||
@@ -2089,4 +2089,6 @@ def test_custom_scrollbar_styles():
|
|||||||
css = read_css()
|
css = read_css()
|
||||||
assert "scrollbar-width: thin" in css, "Firefox scrollbar-width must be set"
|
assert "scrollbar-width: thin" in css, "Firefox scrollbar-width must be set"
|
||||||
assert "::-webkit-scrollbar" in css, "WebKit scrollbar rules must exist"
|
assert "::-webkit-scrollbar" in css, "WebKit scrollbar rules must exist"
|
||||||
assert "border-radius: 3px" in css or "border-radius:3px" in css, "scrollbar thumb must be rounded"
|
assert "border-radius: 3px" in css or "border-radius:3px" in css, (
|
||||||
|
"scrollbar thumb must be rounded"
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user