feat(FN-3608): update dashboard chat documentation

Updated the dashboard chat documentation in the user guide with a minor addition.

Fusion-Task-Id: FN-3608
This commit is contained in:
Fusion
2026-05-06 19:26:14 -07:00
committed by gsxdsm
parent 5dcc888948
commit d791fa90ab
4 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
---
"@runfusion/fusion": patch
---
Fix chat sending silently failing on flaky networks (especially mobile).
The SSE reader in the dashboard client now treats a closed stream without
a terminal `done`/`error` event as an error so streaming state unwinds
instead of getting stuck. The `useChat` and `useQuickChat` hooks also now
show a toast when a message is queued behind an in-flight response, so
the previous stuck state is observable rather than silent.

View File

@@ -8058,6 +8058,7 @@ export function streamChatResponse(
const abortController = new AbortController();
let closedByUser = false;
let terminated = false;
const dispatchEvent = (eventName: string, rawData: string): void => {
if (!eventName) {
@@ -8101,6 +8102,7 @@ export function streamChatResponse(
}
break;
case "done":
terminated = true;
try {
const parsed = JSON.parse(rawData) as { messageId?: unknown; message?: unknown };
handlers.onDone?.({
@@ -8112,6 +8114,7 @@ export function streamChatResponse(
}
break;
case "error":
terminated = true;
try {
const parsed = JSON.parse(rawData);
handlers.onError?.(parsed.message || parsed);
@@ -8216,6 +8219,14 @@ export function streamChatResponse(
processLines(decoder.decode(value, { stream: true }));
}
// Server closed the stream without emitting a terminal `done` or `error`
// SSE event (common on flaky mobile networks, proxy idle-kill, or
// backgrounded tabs). Surface as an error so the client unwinds
// streaming state instead of getting stuck with isStreaming=true.
if (!terminated && !closedByUser) {
handlers.onError?.("Connection closed unexpectedly");
}
} catch (err: unknown) {
if (err instanceof DOMException && err.name === "AbortError") {
if (!closedByUser) {

View File

@@ -492,6 +492,7 @@ export function useChat(
if (isStreaming) {
pendingMessageRef.current = content;
setPendingMessage(content);
addToast?.("Still waiting for previous response — message queued", "warning");
return;
}

View File

@@ -557,6 +557,7 @@ export function useQuickChat(
pendingMessageRef.current = content;
setPendingMessage(content);
addToast?.("Still waiting for previous response — message queued", "warning");
return Promise.resolve();
}