This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-23 19:12:47 -04:00
1 parent d0f759ce40
commit 858e9236df
1 file changed
+4 -1
+4 -1
View File
@@ -960,6 +960,9 @@ async def get_event_emitter(request_info, update_db=True):
if internal and event_data.get('type') == 'notification': if internal and event_data.get('type') == 'notification':
return return
room = f'user:{user_id}'
# Local rooms are authoritative; Redis may have listeners on another instance.
if WEBSOCKET_MANAGER == 'redis' or room in sio.manager.rooms.get('/', {}):
await sio.emit( await sio.emit(
'events', 'events',
{ {
@@ -968,7 +971,7 @@ async def get_event_emitter(request_info, update_db=True):
**({'internal': True} if internal else {}), **({'internal': True} if internal else {}),
'data': event_data, 'data': event_data,
}, },
room=f'user:{user_id}', room=room,
) )
if update_db and message_id and not (request_info.get('chat_id') or '').startswith('local:'): if update_db and message_id and not (request_info.get('chat_id') or '').startswith('local:'):