Repository navigation
fix(chat-history): create the store after the auth database is opened - #12788
Merged
mudler merged 1 commit intoOct 20, 2026
Merged
Conversation
The conversation routes are only registered when the chat history store exists, and the store needs the auth database. It was created in start(), which New() runs before it opens the auth database, so the store was always nil and /api/conversations answered 404 with auth enabled; the React UI fell back to localStorage and nothing was synced between devices. The route tests register the routes with a store directly and never went through New(). Create the store right after the auth database is opened, and cover it through New(): with auth the store exists, without auth or with the WebUI disabled it stays nil. Docs-Not-Needed: bug fix; the documented server-side chat history now works as described Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de>
mudler
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up fix to #12663 (server-side chat history).
The conversation routes are only registered when the chat history store exists, and the store needs the auth database. It was created in
start(), whichNew()runs before it opens the auth database (core/application/startup.go). So the store was always nil and/api/conversationsanswered 404 even with auth enabled; the React UI then fell back to localStorage and nothing synced between devices.The route tests from #12663 register the routes with a store directly and never went through
New(), which is why this slipped through. We found it while probing a build of current master with auth on.Change: create the store right after the auth database is opened (
initChatHistoryStore()).Notes for Reviewers
core/application/chat_history_store_test.go(//go:build auth) goes throughNew(): with auth the store exists; without auth, or with the WebUI disabled, it stays nil. Without the fix the first case fails.Signed commits
Docs-Not-Neededtrailer in the commit)AI assistance is disclosed via the
Assisted-by:trailer.🤖 Generated with Claude Code