[PR #23531] [CLOSED] fix: handle ChatGPT exports containing folder/project metadata entries #66098

Closed
opened 2026-05-06 12:14:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: devHead: fix/chatgpt-import-folder-entries


📝 Commits (1)

  • d260500 fix: handle ChatGPT exports containing folder/project metadata entries

📊 Changes

1 file changed (+8 additions, -1 deletions)

View changed files

📝 src/lib/utils/index.ts (+8 -1)

📄 Description

Pull Request Checklist

  • Target branch: dev
  • Description: See below
  • Changelog: Included
  • Documentation: No user-facing docs needed (existing import flow, no new behavior)
  • Dependencies: None
  • Testing: Manually verified the logic against the reported scenario
  • Agentic AI Code: Reviewed and manually tested
  • Code review: Self-reviewed
  • Design & Architecture: No new settings or architectural changes
  • Git Hygiene: Single atomic commit on dev
  • Title Prefix: fix:

Changelog Entry

Description

ChatGPT recently started including folder and project metadata entries in conversations.json exports. These entries lack a mapping key. When a folder entry appeared first in the array, getImportOrigin() checked only _chats[0], misidentified the file as webui format, and convertOpenAIChats() was never called — resulting in "Imported 0 Chats".

Fixed

  • getImportOrigin(): check if any item has a mapping key (via .some()), not just _chats[0]
  • convertOpenAIChats(): skip entries without mapping before attempting conversion, so folder/project metadata doesn't cause failures

Before

Importing a ChatGPT export that starts with a folder entry:

Imported 0 Chats  (green success toast, but nothing imported)

After

Same file imports correctly — folder/project entries are skipped, all conversations are imported.


Additional Information

Contributor License Agreement


🔄 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/23531 **Author:** [@lawrence3699](https://github.com/lawrence3699) **Created:** 4/9/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/chatgpt-import-folder-entries` --- ### 📝 Commits (1) - [`d260500`](https://github.com/open-webui/open-webui/commit/d26050081c6b11782c242d5f838e595d9c6cd2f0) fix: handle ChatGPT exports containing folder/project metadata entries ### 📊 Changes **1 file changed** (+8 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/utils/index.ts` (+8 -1) </details> ### 📄 Description # Pull Request Checklist - [x] **Target branch:** `dev` - [x] **Description:** See below - [x] **Changelog:** Included - [ ] **Documentation:** No user-facing docs needed (existing import flow, no new behavior) - [x] **Dependencies:** None - [x] **Testing:** Manually verified the logic against the reported scenario - [x] **Agentic AI Code:** Reviewed and manually tested - [x] **Code review:** Self-reviewed - [x] **Design & Architecture:** No new settings or architectural changes - [x] **Git Hygiene:** Single atomic commit on `dev` - [x] **Title Prefix:** `fix:` # Changelog Entry ### Description ChatGPT recently started including folder and project metadata entries in `conversations.json` exports. These entries lack a `mapping` key. When a folder entry appeared first in the array, `getImportOrigin()` checked only `_chats[0]`, misidentified the file as `webui` format, and `convertOpenAIChats()` was never called — resulting in "Imported 0 Chats". ### Fixed - `getImportOrigin()`: check if *any* item has a `mapping` key (via `.some()`), not just `_chats[0]` - `convertOpenAIChats()`: skip entries without `mapping` before attempting conversion, so folder/project metadata doesn't cause failures ### Before Importing a ChatGPT export that starts with a folder entry: ``` Imported 0 Chats (green success toast, but nothing imported) ``` ### After Same file imports correctly — folder/project entries are skipped, all conversations are imported. --- ### Additional Information - Fixes #23505 - The root cause is that ChatGPT exports now contain entries like `{ "id": "...", "title": "My Folder", "type": "folder", ... }` alongside conversation entries. These lack the `mapping` key that conversations have. - Two prior PRs (#23524, #23525) identified the same root cause but were closed due to targeting `main` instead of `dev` and missing CLA. ### Contributor License Agreement - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <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:14:19 -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#66098