[PR #24889] [CLOSED] fix: prevent orphaned knowledge files by ensuring atomic upload-process-link chain (#24807) #131576

Closed
opened 2026-05-21 17:15:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24889
Author: @paulxg12
Created: 5/18/2026
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • 312693a fix: prevent orphaned knowledge files by ensuring atomic upload-process-link chain (#24807)

📊 Changes

1 file changed (+37 additions, -13 deletions)

View changed files

📝 backend/open_webui/routers/knowledge.py (+37 -13)

📄 Description

Closes #24807

Root cause: Knowledge upload pipeline did linking AFTER processing. If user navigated away during the slow embedding step, files were orphaned in the vector DB with no relational record.

Fix: Reversed order — link FIRST (fast), process SECOND (slow). Rollback link on processing failure. Applies to both single-file and batch endpoints.


🔄 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/24889 **Author:** [@paulxg12](https://github.com/paulxg12) **Created:** 5/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`312693a`](https://github.com/open-webui/open-webui/commit/312693acbd7c30ebb599c5ed4a080afb9e76a895) fix: prevent orphaned knowledge files by ensuring atomic upload-process-link chain (#24807) ### 📊 Changes **1 file changed** (+37 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/knowledge.py` (+37 -13) </details> ### 📄 Description Closes #24807 **Root cause**: Knowledge upload pipeline did linking AFTER processing. If user navigated away during the slow embedding step, files were orphaned in the vector DB with no relational record. **Fix**: Reversed order — link FIRST (fast), process SECOND (slow). Rollback link on processing failure. Applies to both single-file and batch endpoints. --- <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-21 17:15:13 -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#131576