From fc509ae281c8cd0aa69870f6123a11e3519fb390 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Tue, 11 Aug 2026 16:19:40 +0200 Subject: fix(hub): move _handle_chat_notify before @router.websocket decorator The function was placed between the decorator and node_websocket, breaking the WebSocket endpoint registration (403 on all WS connects). Co-Authored-By: Claude Opus 4.6 --- packages/meshbay-hub/src/meshbay_hub/api/revocation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/meshbay-hub/src/meshbay_hub/api/revocation.py b/packages/meshbay-hub/src/meshbay_hub/api/revocation.py index 00258c1..c9c59c9 100644 --- a/packages/meshbay-hub/src/meshbay_hub/api/revocation.py +++ b/packages/meshbay-hub/src/meshbay_hub/api/revocation.py @@ -98,7 +98,6 @@ def _sign_revocation(target: str, target_id: str, reason: str) -> str: # ── WebSocket endpoint ──────────────────────────────────────────────────────── -@router.websocket("/v1/nodes/ws") async def _handle_chat_notify(group_id: str, sender_name: str, sender_user_id: str) -> None: """Node informs hub that a chat message was posted — create notifications for offline members.""" if not group_id: @@ -129,6 +128,7 @@ async def _handle_chat_notify(group_id: str, sender_name: str, sender_user_id: s log.warning("Chat notify failed: %s", e) +@router.websocket("/v1/nodes/ws") async def node_websocket(ws: WebSocket): """ Persistent WebSocket connection for nodes. -- cgit v1.2.3