fix(events): a conversation's own stream carries its updates

This commit is contained in:
hh committed 2026-10-13 01:22:40 +02:00
1 parent 65564d8541
commit 9875f08016
2 files changed
+27 -1

No files matched your search

+7 -1
View File
@@ -57,10 +57,16 @@ class EventBus:
event = await queue.get()
if (
conversation_id is None
or event.get("conversation_id") == conversation_id
or _conversation_of(event) == conversation_id
):
yield event
@property
def subscribers(self) -> int:
return len(self._subscribers)
def _conversation_of(event: Event) -> Any:
if event["type"].startswith("conversation."):
return event.get("id")
return event.get("conversation_id")