Skip to content

ui: export conversations from database instead of cached store - #27432

Merged
ServeurpersoCom merged 1 commit into
ggml-org:masterfrom
intel00000:fix/webui-import-currnode
Sep 4, 2026
Merged

ServeurpersoCom merged 1 commit into
ggml-org:masterfrom
intel00000:fix/webui-import-currnode

Conversation

@intel00000

@intel00000 intel00000 commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Overview

bugfix on setting menu export/import

Additional information

When exporting a conversation with branches from the Settings (single or multi conversations), the output jsonl "currNode" field is empty. When this export is imported, all branches are displayed.

The cause: the settings export serialized the conversation header from conversationsStore.conversations, which is a page-load cache and can hold a stale currNode. currNode advances in IndexedDB on message insert, but not all are updated into cache, so a conversation created in the current page session has empty currNode.

To recreate it:

  1. Load the webui fresh, then create a new conversation in that same page session (i.e. don't refresh after).
  2. Send 2-3 messages, then regenerate one to create the branch.
  3. Settings → Export (use the bulk export, not sidebar export, which reads DB and unaffected).
  4. Inspect the exported .jsonl, it'll contain "currNode":"".
  5. Delete the conversation and import the file in the setting menu.
  6. All branches will be displayed at first, click the switching branch arrow, back to normal.

Shown below

Before export
 
image
 
Re-imported
 
image
 
Fix:

  1. Route all three export paths (Settings, sidebar single, sidebar multi-select) through one database read. The Settings path is the bug fix. The two sidebar paths lose their preference for in-memory record, which lost its purpose when ui: export full message tree instead of active path only #25501 moved message loading to DB.
  2. Add a regression test: exports should carry the DB currNode even when in-memory copies are stale.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - AI was used to help draft and refine the implementation.

@intel00000
intel00000 marked this pull request as ready for review August 20, 2026 07:39
@intel00000
intel00000 requested a review from a team as a code owner August 20, 2026 07:39
Copilot AI lite review requested due to automatic review settings August 20, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Fixes Settings/Sidebar conversation export to always source conversations (including currNode) from IndexedDB rather than potentially-stale in-memory cache, preventing imports from showing all branches.

Changes:

  • Centralized export data retrieval via conversationsStore.getConversationsForExport() using DatabaseService.getConversationsWithMessages.
  • Updated Settings export and single-conversation download to use the centralized DB-backed export source.
  • Added unit/regression tests covering stale cache vs DB currNode and branch-pointer import behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tools/ui/src/lib/stores/conversations.svelte.ts Introduces centralized DB-backed export fetch and routes export/download through it.
tools/ui/src/lib/components/app/settings/SettingsChat/SettingsChatImportExportTab.svelte Switches Settings export to use the centralized DB-backed export source.
tools/ui/tests/unit/conversation-export-source.test.ts Adds regression tests ensuring exports use DB currNode and imports restore the correct branch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@intel00000
intel00000 force-pushed the fix/webui-import-currnode branch from b2b12f6 to 6fb5505 Compare August 27, 2026 05:41
@intel00000
intel00000 requested a balanced review from Copilot August 27, 2026 05:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@ServeurpersoCom ServeurpersoCom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ServeurpersoCom
ServeurpersoCom merged commit 1863ac0 into ggml-org:master Sep 4, 2026
6 checks passed
x1250 pushed a commit to x1250/llama.cpp that referenced this pull request Sep 9, 2026
zbrad pushed a commit to zbrad/llama.cpp that referenced this pull request Sep 10, 2026
@intel00000
intel00000 deleted the fix/webui-import-currnode branch September 15, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants