Open Sapessii opened 9 months ago
Having the same issue -- any updates or workarounds on this?
Same issue with me.
I think it comes down to:
However, the auto_reconnect does not seem work properly for me and ignores new events after reconnect. I fixed that behavior in an opinionated fork. This fork does have breaking changes
Hi!
I am facing an issue both in local (Mac OS Sonoma 14.2) and deployed on render.com.
Basically after a while the socket close without receiving further updates and I get this error:
2024-01-26 04:04:08,363:ERROR - Connection with the server closed. Traceback (most recent call last): File "/opt/render/project/src/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 959, in transfer_data message = await self.read_message() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/render/project/src/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1029, in read_message frame = await self.read_data_frame(max_size=self.max_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/render/project/src/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1104, in read_data_frame frame = await self.read_frame(max_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/render/project/src/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 1161, in read_frame frame = await Frame.read( ^^^^^^^^^^^^^^^^^ File "/opt/render/project/src/.venv/lib/python3.11/site-packages/websockets/legacy/framing.py", line 68, in read data = await reader(2) ^^^^^^^^^^^^^^^ File "/opt/render/project/python/Python-3.11.0/lib/python3.11/asyncio/streams.py", line 726, in readexactly raise exceptions.IncompleteReadError(incomplete, n) asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/render/project/src/.venv/lib/python3.11/site-packages/realtime/connection.py", line 76, in _listen msg = await self.ws_connection.recv() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/render/project/src/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 568, in recv await self.ensure_open() File "/opt/render/project/src/.venv/lib/python3.11/site-packages/websockets/legacy/protocol.py", line 930, in ensure_open raise self.connection_closed_exc() websockets.exceptions.ConnectionClosedError: no close frame received or sent
To Reproduce
Expected behavior
The socket should't disconnect.
Additional context
This is my current python code