[PR #20282] [MERGED] fix: clear file hash when processing fails to prevent false duplicate #112856

Closed
opened 2026-05-18 13:04:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 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: devHead: fix/clear-file-hash-on-processing-failure


📝 Commits (1)

  • 9516337 fix: 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.

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 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/20282 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 12/30/2025 **Status:** ✅ Merged **Merged:** 1/5/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/clear-file-hash-on-processing-failure` --- ### 📝 Commits (1) - [`9516337`](https://github.com/open-webui/open-webui/commit/9516337aa5a4457865edfa5ee48ba69066333ba0) fix: clear file hash when processing fails to prevent false duplicate detection ### 📊 Changes **2 files changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/models/files.py` (+1 -1) 📝 `backend/open_webui/routers/retrieval.py` (+2 -0) </details> ### 📄 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)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <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-18 13:04:41 -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#112856