feat(web): wire domain events into realtime stream

This commit is contained in:
jjbrunton committed 2026-08-08 16:00:17 +01:00
1 parent 8c8ff11fd7
commit d5f0175dc2
6 files changed
+155 -1

No files matched your search

+4
View File
@@ -103,6 +103,8 @@ export type SyncProgressListener = (progress: SyncProgress | null) => void;
/** Fired when a chat we sent into first receives a reply from the other party. */
export type NewReplyListener = (info: {
conversationId: string;
replyId: string;
username: string;
replySnippet: string;
}) => void;
@@ -806,6 +808,8 @@ export class ChatService {
this.logger.info(`[chat] stored successful chat example from ${chat.username}`);
try {
this.newReplyListener?.({
conversationId: chat.roomId,
replyId: `${chat.roomId}:${firstReply?.timestamp ?? Date.now()}`,
username: chat.username,
replySnippet: firstReply?.text.slice(0, 200) ?? '',
});