mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-29 01:41:47 +00:00
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 |
||
|---|---|---|
| .. | ||
| data | ||
| internal | ||
| migrations | ||
| models | ||
| retrieval | ||
| routers | ||
| socket | ||
| static | ||
| storage | ||
| tools | ||
| utils | ||
| __init__.py | ||
| alembic.ini | ||
| config.py | ||
| constants.py | ||
| env.py | ||
| functions.py | ||
| main.py | ||
| tasks.py | ||