mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #18859] [CLOSED] fix: Prevents redundant file processing on Knowledge Base upload #48052
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/18859
Author: @NRC-Git
Created: 11/2/2025
Status: ❌ Closed
Base:
dev← Head:main📝 Commits (2)
71d03a3feat: Allow 'process' param in uploadFilefd118acfix: Set process=false on KnowledgeBase file upload📊 Changes
2 files changed (+5 additions, -4 deletions)
View changed files
📝
src/lib/apis/files/index.ts(+4 -3)📝
src/lib/components/workspace/Knowledge/KnowledgeBase.svelte(+1 -1)📄 Description
Fixes #18689
Related to #18571, #14457, #11868, #8240, #11331
Pull Request Checklist
devbranch. Not targeting thedevbranch may lead to immediate closure of the PR.Changelog Entry
Description
Added
Changed
src/lib/apis/files/index.ts: TheuploadFilefunction was updated to accept aprocessparameter (defaulting totrue) and pass it as a query param in itsfetchcall.src/lib/components/workspace/Knowledge/KnowledgeBase.svelte: TheuploadFileHandlerfunction now callsuploadFilewithprocess=falseto prevent the first, redundant processing job.Deprecated
Removed
Fixed
1393d538...) instead of the generic file ID (e.g.,file-bb97c4f9...)] solving duplicate data reports like #8240.file-{uuid}instead of the Knowledge Base ID). This solves issues like #18689 and #18571.504 Gateway Timeouterrors on large file uploads (like in #14457 and #11868) by skipping the first, redundant processing job that was causing the timeout.Security
Breaking Changes
Additional Information
collection_namevalues (file-{uuid}and the Knowledge Base ID) for the same file.process=Truedefault.routers/files.pyfile accepts aprocess: bool = Query(True)parameter. Theupload_file_handlerin that same file only runs the processing inside anif process:block.process=falsefrom the Knowledge Base, we are telling the backend to skip this block for the first API call, which prevents the redundant processing.How to Test This Fix
mainbranch (without this fix).POST /api/v1/files/?process=true(Job 1)POST /api/v1/knowledge/.../file/add(Job 2)vector_dbfolder. You will see two new collections (onefile-...and one with the KB ID).+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fix/...branch.POST /api/v1/files/?process=false(Job 1 - skips processing)POST /api/v1/knowledge/.../file/add(Job 2 - processes the file)vector_dbfolder. You will see only one new collection (the one with the KB ID).Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.