fix(api): prevent browser from coalescing concurrent stream requests
All checks were successful
continuous-integration/drone/push Build is passing

Add cache-busting query parameter to the stream fetch URL so each
tab gets a unique request and the browser cannot reuse an in-flight
response. Remove redundant Transfer-Encoding header that Go sets
automatically.
This commit is contained in:
2026-04-28 23:22:48 -04:00
parent eb66801f58
commit ce496d1caf
2 changed files with 1 additions and 2 deletions

View File

@@ -435,7 +435,6 @@ func (a *API) GetChatStream(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/x-ndjson")
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
w.Header().Set("Transfer-Encoding", "chunked")
flushWriter := newFlushWriter(w)
// Send Snapshot

View File

@@ -120,7 +120,7 @@ export async function streamChatUpdates(
chatId: string,
onChunk: (chunk: MessageChunk) => void,
) {
const response = await fetch(`/api/chats/${chatId}/stream`);
const response = await fetch(`/api/chats/${chatId}/stream?_t=${Date.now()}`);
return streamMessage(response, onChunk);
}