mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 12:58:11 -05:00
[PR #23524] [CLOSED] fix: handle ChatGPT exports with folder/project entries #42867
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23524
Author: @jjjojoj
Created: 4/9/2026
Status: ❌ Closed
Base:
main← Head:fix/23505-chatgpt-import📝 Commits (1)
3bc4ec7fix: handle ChatGPT exports with folder/project entries📊 Changes
1 file changed (+11 additions, -1 deletions)
View changed files
📝
src/lib/utils/index.ts(+11 -1)📄 Description
Summary
Fixes #23505 — Import of ChatGPT export file results in "Imported 0 Chats".
Root Cause
ChatGPT export files (
conversations.json) can include folder and project metadata entries that lack amappingkey. This caused two problems:getImportOrigin()only checked_chats[0]for themappingkey. If a folder entry appeared first in the array, the export was misidentified aswebuiformat andconvertOpenAIChats()was never called — resulting in 0 imports.convertOpenAIChats()did not skip non-conversation entries, so even when origin detection worked, folder/project entries would fail validation silently.Changes
src/lib/utils/index.ts—getImportOrigin(): Check if any item in the array has amappingkey, instead of only checking_chats[0].src/lib/utils/index.ts—convertOpenAIChats(): Skip entries without amappingkey (folders/projects) before attempting conversion, with a console log for visibility.Testing
Tested with a ChatGPT export containing both folder entries and conversations — all conversations are now correctly imported.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.