mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-03 15:27:37 -05:00
[PR #20282] [MERGED] fix: clear file hash when processing fails to prevent false duplicate #48593
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/20282
Author: @Classic298
Created: 12/30/2025
Status: ✅ Merged
Merged: 1/5/2026
Merged by: @tjbck
Base:
dev← Head:fix/clear-file-hash-on-processing-failure📝 Commits (1)
9516337fix: clear file hash when processing fails to prevent false duplicate detection📊 Changes
2 files changed (+3 additions, -1 deletions)
View changed files
📝
backend/open_webui/models/files.py(+1 -1)📝
backend/open_webui/routers/retrieval.py(+2 -0)📄 Description
When file processing fails (e.g., OCR errors), the file hash was stored in the database before the error occurred. This caused subsequent upload attempts of the same file to be incorrectly blocked as duplicates, even though the file was never successfully processed.
Changes:
Clear file hash in the exception handler of process_file()
Update type hint to accept Optional[str] for hash parameter
Fixes #19264
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.