From 2ad7bca98931e5c86e837d0023006736fdde44fb Mon Sep 17 00:00:00 2001 From: jgonewu Date: Wed, 15 Jul 2026 10:27:00 +0800 Subject: [PATCH] fix(wecom): add CLOSING state to _wait_for_handshake terminal handler _wait_for_handshake() was missing aiohttp.WSMsgType.CLOSING from its terminal state check, causing WeCom reconnection to fail permanently after mass restart when the server sends a CLOSING frame during the authentication handshake. This mirrors the identical fix already applied to _read_events() in #28311 (for issue #28293), which was overlooked in _wait_for_handshake(). Fixes: #64703 --- plugins/platforms/wecom/adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/platforms/wecom/adapter.py b/plugins/platforms/wecom/adapter.py index 7d809c19a2f5d..ecd2236b590d0 100644 --- a/plugins/platforms/wecom/adapter.py +++ b/plugins/platforms/wecom/adapter.py @@ -329,7 +329,7 @@ async def _wait_for_handshake(self, req_id: str) -> Dict[str, Any]: if self._payload_req_id(payload) == req_id: return payload logger.debug("[%s] Ignoring pre-auth payload: %s", self.name, payload.get("cmd")) - elif msg.type in {aiohttp.WSMsgType.CLOSED, aiohttp.WSMsgType.CLOSE, aiohttp.WSMsgType.ERROR}: + elif msg.type in {aiohttp.WSMsgType.CLOSED, aiohttp.WSMsgType.CLOSE, aiohttp.WSMsgType.ERROR, aiohttp.WSMsgType.CLOSING}: raise RuntimeError("WeCom websocket closed during authentication") async def _listen_loop(self) -> None: