fix: isolate chat SSE broadcasts per generation
After stopping a streaming chat reply, the next message would appear sent but show no Stop button or "Connecting…" indicator. The cancel broadcast from the prior generation was leaking into the new SSE subscription and immediately marking it as errored. Each `chatManager.sendMessage` now allocates a per-generation id; `ChatStreamManager` only delivers tagged broadcasts to subscribers from the matching generation. `sendMessage`'s cleanup also stops deleting a newer generation's `activeGenerations` slot when an older one finally unwinds. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
5
.changeset/fix-chat-cancel-leak-into-new-stream.md
Normal file
5
.changeset/fix-chat-cancel-leak-into-new-stream.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Fix chat: after stopping a streaming reply, the next message would appear sent but show no Stop button or "Connecting…" indicator. The cancellation broadcast from the previous generation was leaking into the new SSE subscription, immediately marking it as errored. Each `chatManager.sendMessage` now allocates a per-generation id; `ChatStreamManager` only delivers tagged broadcasts to subscribers from the matching generation, and `sendMessage`'s cleanup no longer deletes a newer generation's `activeGenerations` slot when an older one finally unwinds.
|
||||
Reference in New Issue
Block a user