fix: keep pending Knowledge uploads visible after reload#25143
Open
hytg wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
Closes #25031. If one does not exist, create one first. PRs without a linked issue or discussion may be closed without review.devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
This PR fixes #25031, where an in-progress Knowledge upload can disappear from the Knowledge page after reload/remount.
The backend may still be processing the upload, but the temporary frontend row is lost. During that window, the Knowledge page can appear empty and show
No content found, making the upload look lost or failed.This PR keeps the accepted upload visible by linking the file to the Knowledge Collection before slow backend work starts, then restoring the in-progress row from the persisted Knowledge file list.
Terminology
This PR distinguishes two backend stages:
This PR does not add a full multi-step progress UI. It only keeps the accepted upload visible while backend work is still in progress.
Timing
Before:
After:
Added
Changed
Deprecated
Removed
Fixed
No content foundwhile an accepted upload is still processing.Security
Breaking Changes
Additional Information
This is intentionally a minimal bug fix.
It does not add:
embedding...The goal is only: once a Knowledge upload is accepted, the file should not disappear from the Knowledge page during backend processing.
Manual Tests
Tested with a Playwright evidence runner using a 120-page PDF (
p120.pdf) and a reload/remount while backend processing was still running.No content foundfor an accepted upload.Evidence:
Before, unpatched upstream
devimage (ghcr.io/open-webui/open-webui:dev, commit5d9a09a88a9094ebfcd249340be3aaee544b34d0): the same runner left the file outside the Knowledge file list after reload/remount.200200, aborted by reload/remount/api/v1/knowledge/{knowledge_id}/file/add: not sent by the client before interruptionAfter, patched
origin/devcommit5d9a09a88a9094ebfcd249340be3aaee544b34d0with this patch applied locally: reload/remount during processing kept the uploaded file linked to the Knowledge Collection.200200, aborted by reload/remount/api/v1/knowledge/{knowledge_id}/file/add: not sent by the client before interruptionScreenshots or Videos
No content found.before-unpatched-reload-remount-first-11s.mp4
After:
after-patched-reload-remount-first-11s.mp4
Contributor License Agreement
Note
Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.