Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apps/web/src/chat/threads-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,11 @@ export async function readChat(tenantId: string, chatId: string): Promise<ChatTh
export function subscribeToInbox(tenantId: string, onChange: () => void): () => void {
const source = new EventSource(`${mailboxPath(tenantId)}/events`);
const handler = () => onChange();
source.addEventListener("message", handler);
// The stream writes named `mailbox` frames; the default `message` event
// never fires for those.
source.addEventListener("mailbox", handler);
return () => {
source.removeEventListener("message", handler);
source.removeEventListener("mailbox", handler);
source.close();
};
}
Expand Down
Loading