From a5cfccbdfcc0b2e2cfc4b8244693174b7a08f713 Mon Sep 17 00:00:00 2001 From: Jonas Weinz Date: Thu, 21 Mar 2019 15:42:34 +0100 Subject: [PATCH] handle reconnects correctly --- connection_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/connection_handler.py b/connection_handler.py index 405856c..940ab66 100644 --- a/connection_handler.py +++ b/connection_handler.py @@ -123,10 +123,12 @@ class ConnectionHandler(object): conn = self.reconnect_session(socket, msg['data']['id']) if conn is not None: self._add_connection(conn) - await conn.send(json.dumps({ + await socket.send(json.dumps({ "type": "reconnect_response", "data": { "success": True, + "id": conn.id, + "user": conn.user_name, "msg": "" } })) @@ -135,6 +137,8 @@ class ConnectionHandler(object): "type": "reconnect_response", "data": { "success": False, + "id": conn.id, + "user": conn.user_name, "msg": "session not available" } }))