fix: reply in a new chat sometimes stays blank until reload (#32181)

In a new chat the reply sometimes stayed blank and looked like it was still generating, with the loading animation and the Stop button, even though the answer was complete on the server. Reloading the page showed it. It happened when the chat's new title arrived while the reply was still coming in: refreshing the chat list with the new title replaced the finished answer with a blank one. A title or tag update no longer overwrites the reply, so the finished answer shows as soon as it is done.

Fixes #32091
This commit is contained in:
Classic298 2026-10-10 17:56:02 +02:00 • committed by GitHub
parent e0b0edfeb0
commit 958ad36734
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1549,9 +1549,11 @@
await onEmbeddedChatTitle?.($chatId, data);
}
await refreshChatList(localStorage.token);
return; // The message copy is stale after the await; skip the trailing write-back.
} else if (type === 'chat:tags') {
chat = await getChatById(localStorage.token, $chatId);
allTags.set(await getAllTags(localStorage.token));
return;
} else if (type === 'source' || type === 'citation') {
if (data?.type === 'code_execution') {
// Code execution; update existing code execution by ID, or add new one.