From 3257fec16214bf6444c686073892d00a780c7586 Mon Sep 17 00:00:00 2001 From: sidtuladhar Date: Tue, 21 Jan 2025 17:51:18 +0800 Subject: [PATCH 1/2] fix: add token authentication on reconnect --- realtime/_async/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/realtime/_async/client.py b/realtime/_async/client.py index 71cbcc5..10b3030 100644 --- a/realtime/_async/client.py +++ b/realtime/_async/client.py @@ -101,6 +101,8 @@ async def _listen(self) -> None: if self.auto_reconnect: logger.info("Connection with server closed, trying to reconnect...") await self.connect() + if self.access_token: + await self.set_auth(self.access_token) for topic, channel in self.channels.items(): await channel.join() else: From b10fc11840080bc1343db2e3a1638e2c3aa34996 Mon Sep 17 00:00:00 2001 From: sidtuladhar Date: Wed, 22 Jan 2025 16:20:46 +0800 Subject: [PATCH 2/2] fix: correct payload during channel connection --- realtime/_async/client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/realtime/_async/client.py b/realtime/_async/client.py index 10b3030..41a9c44 100644 --- a/realtime/_async/client.py +++ b/realtime/_async/client.py @@ -101,10 +101,8 @@ async def _listen(self) -> None: if self.auto_reconnect: logger.info("Connection with server closed, trying to reconnect...") await self.connect() - if self.access_token: - await self.set_auth(self.access_token) for topic, channel in self.channels.items(): - await channel.join() + await channel._rejoin() else: logger.exception("Connection with the server closed.") break