From 35564622fe3fd2f989c2e61ed39df7975f24d444 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Mon, 30 Nov 2026 23:33:19 +0100 Subject: [PATCH] fix: event webhooks subscribed to a renamed event vanish after upgrading (#35417) Several events were renamed, and admin event webhooks saved under the old names were treated as invalid: they disappeared from the webhook list, stopped firing, and were deleted the next time any webhook was saved. Creating a notification target with an old name was refused as well. Old event names are now accepted and translated to the new ones, for event webhooks and notification targets alike, as was already done for an earlier rename. Fixes #35413 --- backend/open_webui/events.py | 18 +++++++++++++++++- backend/open_webui/utils/notifications.py | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/events.py b/backend/open_webui/events.py index a1f59cf5c9..4921144c6f 100644 --- a/backend/open_webui/events.py +++ b/backend/open_webui/events.py @@ -20,7 +20,23 @@ log = logging.getLogger(__name__) MAX_STRING_LENGTH = 1000 EVENT_WEBHOOKS_CONFIG_KEY = 'events.webhooks' # Renamed events, so saved webhook filters that name the old event keep working (and are not skipped as invalid). -LEGACY_EVENT_NAMES = {'config.terminal_servers.updated': 'config.machines.updated'} +LEGACY_EVENT_NAMES = { + 'config.terminal_servers.updated': 'config.machines.updated', + 'auth.signup': 'auth.signed_up', + 'auth.login': 'auth.logged_in', + 'auth.logout': 'auth.logged_out', + 'chat.finished': 'chat.response_completed', + 'chat.failed': 'chat.response_failed', + 'chat.deleted_all': 'chat.all_deleted', + 'channel.message': 'channel.message_posted', + 'file.deleted_all': 'file.all_deleted', + 'function.enable_started': 'function.enabling', + 'function.disable_started': 'function.disabling', + 'calendar.alert': 'calendar.alert_triggered', + 'feedback.deleted_all': 'feedback.all_deleted', + 'notification.test': 'notification.test_sent', + 'notification.manual': 'notification.sent', +} LEGACY_WEBHOOK_CONFIG_KEY = 'webhook_url' DEFAULT_WEBHOOK_ID = 'default' diff --git a/backend/open_webui/utils/notifications.py b/backend/open_webui/utils/notifications.py index 71c642cbf7..37d52f9326 100644 --- a/backend/open_webui/utils/notifications.py +++ b/backend/open_webui/utils/notifications.py @@ -6,7 +6,7 @@ import time from typing import Any from urllib.parse import urlparse, quote -from open_webui.events import EVENT_DEFINITIONS_BY_NAME, NOTIFICATION_EVENTS +from open_webui.events import EVENT_DEFINITIONS_BY_NAME, LEGACY_EVENT_NAMES, NOTIFICATION_EVENTS from open_webui.models.config import Config from open_webui.models.users import Users from open_webui.retrieval.web.utils import validate_url @@ -56,7 +56,7 @@ def _normalize_target(target: dict[str, Any], existing: dict[str, Any] | None = raise ValueError('events must be a list') cleaned_events = [] for event in events: - event = str(event) + event = LEGACY_EVENT_NAMES.get(str(event), str(event)) if event not in VALID_EVENTS: raise ValueError(f'unsupported notification event: {event}') if event not in cleaned_events: