mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-17 23:52:29 +00:00
A file content update should not leave knowledge collections emptier than before. The previous flow deleted old vectors first and then attempted the rebuild, so any downstream processing failure could leave the KB without embeddings even though the route returned success.\n\nThis change rebuilds the file's knowledge entries first and only deletes the stale vector ids after the new insert succeeds. The fix is kept narrow to the file-update propagation path and adds a focused regression test for the helper that preserves old ids when reindexing raises.\n\nConstraint: Keep the fix scoped to one retrieval correctness bug without refactoring broader embedding flows\nRejected: Fail the route after deleting old vectors | still leaves the KB empty and does not preserve data\nRejected: Broad temporary-collection refactor | larger than needed for a first bugfix PR\nConfidence: high\nScope-risk: narrow\nReversibility: clean\nDirective: Preserve old vector ids until rebuild success remains observable in tests; do not revert to delete-first ordering\nTested: py_compile on modified modules; PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=backend pytest -q backend/open_webui/test/util/test_knowledge_collections.py; local source-faithful harness reproducing old failure mode\nNot-tested: Full application boot with live vector database backends |
||
|---|---|---|
| .. | ||
| access_control | ||
| images | ||
| mcp | ||
| telemetry | ||
| actions.py | ||
| anthropic.py | ||
| asgi_middleware.py | ||
| audit.py | ||
| auth.py | ||
| automations.py | ||
| channels.py | ||
| chat.py | ||
| code_interpreter.py | ||
| embeddings.py | ||
| files.py | ||
| filter.py | ||
| groups.py | ||
| headers.py | ||
| knowledge_collections.py | ||
| logger.py | ||
| middleware.py | ||
| misc.py | ||
| models.py | ||
| oauth.py | ||
| payload.py | ||
| pdf_generator.py | ||
| plugin.py | ||
| rate_limit.py | ||
| redis.py | ||
| response.py | ||
| sanitize.py | ||
| security_headers.py | ||
| session_pool.py | ||
| task.py | ||
| tools.py | ||
| validate.py | ||
| webhook.py | ||