open-webui/backend
Asish Kumar 67a7e0b1d1
fix: drop dangling folder references when importing chats
Chat exports serialize each chat's `folder_id`, but the export does not
include the folders themselves. When such an export is imported into a
different instance (or the same instance after the folders were deleted),
those `folder_id` values point at folders that no longer exist for the
importing user.

`POST /api/v1/chats/import` stored the values verbatim. Because the chat
list query filters out every chat with a non-null `folder_id` (and there
is no matching folder to surface them from), the imported chats became
invisible even though the import reported success.

Sanitize folder references on import: keep folder_ids the user actually
owns (so re-importing on the same instance restores the original
grouping) and reset unknown ones to NULL so the chats land in the main
chat list. This mirrors the existing folder validation in
`POST /api/v1/chats/new` and leaves the clone endpoints, which pass an
already-owned folder_id, unaffected.

Closes #24910
2026-05-25 08:42:47 +05:30
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
open_webui fix: drop dangling folder references when importing chats 2026-05-25 08:42:47 +05:30
.dockerignore fix: litellm config issue 2024-02-24 22:35:11 -08:00
.gitignore refac 2024-09-06 04:59:20 +02:00
dev.sh refac 2026-03-24 19:43:30 -05:00
requirements-min.txt refac 2026-04-24 18:20:10 +09:00
requirements.txt refactor(firecrawl): use v2 API directly (#23934) 2026-04-24 18:32:08 +09:00
start.sh fix: default optional env vars used with bash ,, in start.sh (#24683) 2026-05-15 09:29:25 +09:00
start_windows.bat refac 2026-04-24 15:40:02 +09:00