mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 12:58:11 -05:00
[PR #23525] [CLOSED] fix: handle ChatGPT exports with folder/project entries #42868
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/23525
Author: @jjjojoj
Created: 4/9/2026
Status: ❌ Closed
Base:
dev← Head:fix/23505-chatgpt-import📝 Commits (1)
2b7cb47fix: 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 a mapping key. This caused two problems:
getImportOrigin()only checked_chats[0]for the mapping key. If a folder entry appeared first in the array, the export was misidentified as webui format 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 a mapping key, instead of only checking_chats[0].src/lib/utils/index.ts—convertOpenAIChats(): Skip entries without a mapping key (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.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.