Chat2DB Edition
Chat2DB Community
Chat2DB Version
Current main at 7379139e.
Deployment
Web
Operating System
macOS
Operating System Version
26.5.1 (25F80)
Affected Area
AI chat conversation header and conversation list state.
Minimal Reproduction
- Open an existing AI chat conversation.
- Rename it from the editable chat header.
- Let
POST /api/ai/chat/update complete successfully.
- Inspect the active conversation title or another component subscribed only to the chat list.
Expected Behavior
After the request succeeds, both the matching conversation-list entry and the active conversation for the page use the new title. The previous Zustand state remains immutable.
Actual Behavior
updateChatInfo replaces an element inside the existing chatList array and writes that same array reference back to the store. It then spreads the chat fields into the top-level currentChat page map instead of merging them into currentChat[page].
As a result, the active conversation object keeps its old title, chat fields such as id and title leak into the page map, and selectors that only observe the list can miss the update because its reference is unchanged. If the list has not loaded the conversation yet, the early return also prevents the active conversation from being updated.
Proposed Fix
Apply the successful update through an immutable state merge: map the matching list entry to a new object and merge the metadata into the matching active page slot. Add a regression contract covering state shape, immutability, and the list-not-loaded case.
Impact
Limited or cosmetic impact
Conversation renames can appear stale until another refresh or state change, despite being persisted successfully on the server.
Workaround
A reliable workaround exists
Reloading the page refreshes the persisted title from the server.
Submission Checklist
Chat2DB Edition
Chat2DB Community
Chat2DB Version
Current
mainat7379139e.Deployment
Web
Operating System
macOS
Operating System Version
26.5.1 (25F80)
Affected Area
AI chat conversation header and conversation list state.
Minimal Reproduction
POST /api/ai/chat/updatecomplete successfully.Expected Behavior
After the request succeeds, both the matching conversation-list entry and the active conversation for the page use the new title. The previous Zustand state remains immutable.
Actual Behavior
updateChatInforeplaces an element inside the existingchatListarray and writes that same array reference back to the store. It then spreads the chat fields into the top-levelcurrentChatpage map instead of merging them intocurrentChat[page].As a result, the active conversation object keeps its old title, chat fields such as
idandtitleleak into the page map, and selectors that only observe the list can miss the update because its reference is unchanged. If the list has not loaded the conversation yet, the early return also prevents the active conversation from being updated.Proposed Fix
Apply the successful update through an immutable state merge: map the matching list entry to a new object and merge the metadata into the matching active page slot. Add a regression contract covering state shape, immutability, and the list-not-loaded case.
Impact
Limited or cosmetic impact
Conversation renames can appear stale until another refresh or state change, despite being persisted successfully on the server.
Workaround
A reliable workaround exists
Reloading the page refreshes the persisted title from the server.
Submission Checklist