~nicoco/matteridge

592064e888f2f65844352337ddb833fbeae69b03 — nicoco 1 year, 14 days ago 8fb20ab
fix: websocket: do not write to close/closing transport

Not sure why we need that now, probably bad
test and/or aiohttp behaviour change?
1 files changed, 2 insertions(+), 1 deletions(-)

M matteridge/websocket.py
M matteridge/websocket.py => matteridge/websocket.py +2 -1
@@ 70,6 70,7 @@ class Websocket:
                self._connecting.notify_all()
            self._attempts = 0
            await self.listen(ws, event_handler)
        self._connected = False

    async def _initial_connect_sequence(self, ws: aiohttp.ClientWebSocketResponse):
        self._seq_cursor = 1


@@ 113,7 114,7 @@ class Websocket:
            fut.set_result(payload)

    async def __request(self, action: str, data: Optional[dict] = None):
        if not self._connected:
        if not self._connected or self._ws and self._ws.closed:
            async with self._connecting:
                await self._connecting.wait()
        assert self._ws is not None