WeKnora/internal/application
Jin cbfd66fd92
fix(knowledge): delete written chunks when the storage quota check fails (#3656)
* fix(knowledge): delete written chunks when the storage quota check fails

processChunks writes the chunks before the storage quota check. When the
check fails, or the tenant cannot be re-read for it, the knowledge is marked
failed and the function returned without removing those chunks, so they
stayed active (deleted_at IS NULL, is_enabled = true) under a failed,
disabled knowledge. The BatchIndex failure path already deletes them; do the
same in both quota branches. Nothing has been indexed at that point, so only
the chunk rows need removing.

Fixes #3648

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style(knowledge): keep the processChunks doc comment on processChunks

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-10-08 13:14:10 +08:00
..
access feat(wiki): 增加跨知识库 Wiki 搜索 POST /wiki-search (#3535) 2026-09-25 22:22:58 +08:00
repository fix(qdrant): CopyIndices 用服务端返回的 next_page_offset 翻页,不再按页尾 id 回填 (#3882) 2026-10-08 13:04:43 +08:00
service fix(knowledge): delete written chunks when the storage quota check fails (#3656) 2026-10-08 13:14:10 +08:00