[PR #23524] [CLOSED] fix: handle ChatGPT exports with folder/project entries #66093

Closed
opened 2026-05-06 12:13:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23524
Author: @jjjojoj
Created: 4/9/2026
Status: Closed

Base: mainHead: fix/23505-chatgpt-import


📝 Commits (1)

  • 3bc4ec7 fix: 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:

  1. 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 and convertOpenAIChats() was never called — resulting in 0 imports.

  2. 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.tsgetImportOrigin(): Check if any item in the array has a mapping key, instead of only checking _chats[0].
  • src/lib/utils/index.tsconvertOpenAIChats(): 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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/23524 **Author:** [@jjjojoj](https://github.com/jjjojoj) **Created:** 4/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/23505-chatgpt-import` --- ### 📝 Commits (1) - [`3bc4ec7`](https://github.com/open-webui/open-webui/commit/3bc4ec7242e1dd66114a5f3ab824bb229743c4dd) fix: handle ChatGPT exports with folder/project entries ### 📊 Changes **1 file changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/utils/index.ts` (+11 -1) </details> ### 📄 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: 1. **`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 and `convertOpenAIChats()` was never called — resulting in 0 imports. 2. **`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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 12:13:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#66093