From ef7c769abec81ef5b136286ffa18d477de090011 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Mon, 20 Jan 2025 19:17:34 +0100 Subject: [PATCH] wip(sync): remove a bit of server prints --- umap/sync/app.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/umap/sync/app.py b/umap/sync/app.py index be89a4fe..4db280a9 100644 --- a/umap/sync/app.py +++ b/umap/sync/app.py @@ -33,22 +33,16 @@ async def sync(scope, receive, send, **kwargs): peer._send = send while True: event = await receive() - print("EVENT", event) if event["type"] == "websocket.connect": try: - print("Let's accept") await peer.connect() - print("After connect") await send({"type": "websocket.accept"}) - print("After accept") except ValueError: await send({"type": "websocket.close"}) if event["type"] == "websocket.disconnect": - print("Closing", event) await peer.disconnect() - print("Closed") break if event["type"] == "websocket.receive": @@ -121,7 +115,7 @@ class Peer: async def receive(self, text_data): if not self.is_authenticated: - print("AUTHENTICATING", self.uuid) + print("AUTHENTICATING", text_data) message = JoinRequest.model_validate_json(text_data) signed = TimestampSigner().unsign_object(message.token, max_age=30) user, room_id, permissions = signed.values() @@ -155,7 +149,7 @@ class Peer: await self.send_to(incoming.root.recipient, text_data) async def send(self, text): - print("SEND", text) + print(" FORWARDING TO", self.peer_id, text) await self._send({"type": "websocket.send", "text": text})