diff --git a/backend/open_webui/routers/chats.py b/backend/open_webui/routers/chats.py index ec73b8662..06eb04793 100644 --- a/backend/open_webui/routers/chats.py +++ b/backend/open_webui/routers/chats.py @@ -416,7 +416,7 @@ async def update_chat_message_by_id( ) if event_emitter: - event_emitter( + await event_emitter( { "type": "chat:message", "data": { diff --git a/backend/open_webui/socket/main.py b/backend/open_webui/socket/main.py index bc4bc887d..3bf964e5b 100644 --- a/backend/open_webui/socket/main.py +++ b/backend/open_webui/socket/main.py @@ -272,8 +272,16 @@ async def disconnect(sid): def get_event_emitter(request_info, update_db=True): async def __event_emitter__(event_data): user_id = request_info["user_id"] + session_ids = list( - set(USER_POOL.get(user_id, []) + [request_info["session_id"]]) + set( + USER_POOL.get(user_id, []) + + ( + [request_info.get("session_id")] + if request_info.get("session_id") + else [] + ) + ) ) for session_id in session_ids: