We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f78964 commit 26fb61aCopy full SHA for 26fb61a
src/replit_river/v2/client_session.py
@@ -157,14 +157,15 @@ async def _handle_messages_from_ws(self) -> None:
157
try:
158
ws = self._ws_unwrapped
159
while True:
160
+ if not self._ws_unwrapped:
161
+ # We should not process messages if the websocket is closed.
162
+ break
163
+
164
# decode=False: Avoiding an unnecessary round-trip through str
165
# Ideally this should be type-ascripted to : bytes, but there is no
166
# @overrides in `websockets` to hint this.
167
message = await ws.recv(decode=False)
168
- if not self._ws_unwrapped:
- # We should not process messages if the websocket is closed.
- break
169
msg = parse_transport_msg(message)
170
171
logger.debug(f"{self._transport_id} got a message %r", msg)
0 commit comments