This commit is contained in:
Timothy Jaeryang Baek committed 2026-08-10 23:13:10 -06:00
1 parent de289eb1aa
commit ce3c175e26
7 files changed
+109 -40

No files matched your search

+15 -1
View File
@@ -1080,6 +1080,20 @@ class NotificationEventSink:
schedule_notification_dispatch(app, event)
class SocketSessionEventSink:
async def handle_event(self, app: Any, event: Event, request: Any | None = None) -> None:
if event.event not in {EVENTS.USER_DELETED.name, EVENTS.USER_ROLE_UPDATED.name}:
return
subject = event.subject or {}
if subject.get('type') != 'user' or not subject.get('id'):
return
from open_webui.socket.main import disconnect_user_sessions
await disconnect_user_sessions(str(subject['id']))
async def dispatch_event_functions(
app: Any, event: Event, request: Any | None = None, extra_function_ids: list[str] | None = None
) -> None:
@@ -1148,7 +1162,7 @@ class EventFunctionSink:
schedule_event_function_dispatch(app, event, request)
EVENT_SINKS = [EventFunctionSink(), WebhookEventSink(), NotificationEventSink()]
EVENT_SINKS = [SocketSessionEventSink(), EventFunctionSink(), WebhookEventSink(), NotificationEventSink()]
async def publish_event(