From 5e1f4d8c33f173c6f5445fc81f1329b430c05cf1 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 1 Oct 2026 05:52:07 +0200 Subject: [PATCH] fix: subscribe members added to a channel to its live feed (#31113) A user added to an existing group or DM channel saw nothing from it until they reloaded the page: the channel did not appear in their sidebar, and opening it by URL showed the history but no new messages, edits, pins or reactions. Adding members now does what channel creation already does for its participants: the newly inserted members get a `channel:created` event so their sidebar refreshes, and their open sessions join the channel room so live updates reach them. Standard channels are skipped because their access comes from access grants, matching the membership-removal path. Verified against a running server with two live Socket.IO clients: the added user's open session now gets the sidebar refresh and the next message immediately; re-adding an existing member, removal and standard channels behave as before. Fixes #30432 --- backend/open_webui/routers/channels.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/open_webui/routers/channels.py b/backend/open_webui/routers/channels.py index 2a16e23be2..d8aeb65619 100644 --- a/backend/open_webui/routers/channels.py +++ b/backend/open_webui/routers/channels.py @@ -649,6 +649,14 @@ async def add_members_by_id( memberships = await Channels.add_members_to_channel( channel.id, user.id, form_data.user_ids, form_data.group_ids, db=db ) + if channel.type in ['group', 'dm']: + participant_ids = [member.user_id for member in memberships] + await emit_to_users( + 'events:channel', + {'data': {'type': 'channel:created'}}, + participant_ids, + ) + await enter_room_for_users(f'channel:{channel.id}', participant_ids) await publish_event( request,