mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-10 20:40:18 +02:00
fix: mark in-place created chats as read on new chat (#25782)
A chat created in place (new chat -> first message) keeps chatIdProp undefined because the URL is swapped via history.replaceState without a remount, so none of the chatIdProp-gated updateLastReadAt paths fire and the chat is never persisted with a last_read_at. Starting another new chat via initNewChat reset $chatId without marking the outgoing chat read, so on refresh updated_at > last_read_at (NULL) and the chat shows as unread in the sidebar. Mark the outgoing chat read in initNewChat, mirroring navigateHandler. Fixes #25108 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1199,6 +1199,13 @@
|
||||
|
||||
const initNewChat = async () => {
|
||||
console.log('initNewChat');
|
||||
|
||||
// Mark the outgoing chat as read before resetting; in-place created chats
|
||||
// keep chatIdProp undefined, so navigateHandler never marks them read.
|
||||
if ($chatId && !$temporaryChatEnabled) {
|
||||
updateLastReadAt($chatId);
|
||||
}
|
||||
|
||||
if ($user?.role !== 'admin' && $user?.permissions?.chat?.temporary_enforced) {
|
||||
await temporaryChatEnabled.set(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user