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: