From 3b2b89205e4fff7e4546ca4034e0293e2d1bd3f3 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 14 Oct 2026 15:16:22 +0200 Subject: [PATCH] fix: no channel message webhooks from group channels and direct messages (#32404) Users with a notification webhook for channel messages received no webhook when someone posted in a group channel or direct message they belong to. Only regular channels they had been given access to sent it. Members of group channels and direct messages now get the webhook too, and muting one of these channels stops the webhook except for messages that mention them. Fixes #32403 --- backend/open_webui/routers/channels.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/channels.py b/backend/open_webui/routers/channels.py index 71d45733c5..633ceb1d70 100644 --- a/backend/open_webui/routers/channels.py +++ b/backend/open_webui/routers/channels.py @@ -1098,10 +1098,12 @@ async def send_notification(request, channel, message, active_user_ids, db=None) webui_url = await Config.get('webui.url') enable_user_webhooks = await Config.get('ui.enable_user_webhooks') - users = await get_channel_users_with_access(channel, 'read', db=db) - # Batch fetch channel members in 1 query (fixes N+1) members = {m.user_id: m for m in await Channels.get_members_by_channel_id(channel.id, db=db)} + if channel.type in ['group', 'dm']: + users = await Users.get_users_by_user_ids(list(members), db=db) + else: + users = await get_channel_users_with_access(channel, 'read', db=db) mentioned_user_ids = {m['id'] for m in extract_mentions(message.content) if m['id_type'] == 'U'} url = f'{webui_url}/channels/{channel.id}'