WeKnora/internal/handler
ochan.kwon db7baad84c fix: reject cross-store reuse_vectors knowledge move
Moving knowledge with mode=reuse_vectors copies vector index entries
directly between knowledge bases, which only works when both KBs are
bound to the same vector store (CopyIndices is routed through the source
store). Nothing rejected a cross-store reuse_vectors move, so it would
copy target-KB rows into the source store and then delete the source
indices — corrupting vector data. The move endpoint validated only the
embedding model, and ListMoveTargets surfaces same-model KBs regardless
of their store binding, so a cross-store target is reachable.

Reject reuse_vectors moves whose source and target KBs are bound to
different vector stores:

- MoveKnowledge handler: synchronous 400 before enqueueing, with a
  message pointing the caller at reparse mode.
- moveOneKnowledge: re-check before marking the knowledge as processing,
  so a rejected move leaves it untouched rather than stranded.
- moveKnowledgeReuseVectors: a top-of-function guard as defense in depth
  for any directly enqueued task, satisfying the pre-existing contract
  noted in the comment ("callers must reject cross-store moves").

reparse mode is unaffected: it re-indexes into the target store from
scratch and is the supported way to move across stores.
2026-06-05 15:00:41 +08:00
..
dto fix: add model display name 2026-05-28 19:22:17 +08:00
session refactor(chat): improve handling of <think> tags in chat messages 2026-06-05 14:56:48 +08:00
audit_log.go feat(system): expose platform audit log + polish audit drawers 2026-05-26 21:13:56 +08:00
audit_log_test.go test(system): cover ListSystemAuditLog handler contract 2026-05-26 21:13:56 +08:00
auth.go feat(rbac): add multi-use share-link invitations for invite_only mode (#1504) 2026-05-27 19:42:01 +08:00
auth_register_by_invite.go feat(rbac): add multi-use share-link invitations for invite_only mode (#1504) 2026-05-27 19:42:01 +08:00
auth_register_invite_only_test.go feat(rbac): add multi-use share-link invitations for invite_only mode (#1504) 2026-05-27 19:42:01 +08:00
chunk.go feat: Support filtering chunks by multiple chunk_type params 2026-05-25 19:14:46 +08:00
chunker_debug.go docs(api): add and fix swag annotations on handlers 2026-05-12 13:16:58 +08:00
chunker_debug_test.go fix(chunker): post-review fixes for preview endpoint robustness 2026-05-06 17:17:07 +08:00
custom_agent.go feat(creator_name): add creator_name field to agents and knowledge bases for enhanced visibility 2026-05-18 17:28:58 +08:00
datasource.go fix(swagger): Fix some Swagger API endpoints returning 404 errors and regenerate the Swagger documentation 2026-05-21 21:13:40 +08:00
datasource_credentials.go refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
evaluation.go feat: 新增API Key认证支持,优化Swagger文档安全配置 2025-12-22 15:01:09 +08:00
faq.go refactor(rbac): KB-access guard at the route layer (no helper in handlers) 2026-05-18 17:28:58 +08:00
im.go docs(api): add and fix swag annotations on handlers 2026-05-12 13:16:58 +08:00
initialization.go feat(lkeap): integrate Tencent Cloud LKEAP Rerank support 2026-06-04 17:22:18 +08:00
knowledge.go fix: reject cross-store reuse_vectors knowledge move 2026-06-05 15:00:41 +08:00
knowledge_move_gate_test.go fix: reject cross-store reuse_vectors knowledge move 2026-06-05 15:00:41 +08:00
knowledge_spans_test.go fix(knowledge): infer synthesized stage status from parse_status 2026-05-28 15:14:45 +08:00
knowledgebase.go fix: deep-copy stored files and images when cloning a knowledge base 2026-06-03 14:45:59 +08:00
knowledgebase_copy_preflight_test.go feat(knowledge-base): validate vector store bindings on create, copy, and delete 2026-05-18 15:58:46 +08:00
knowledgebase_not_found_test.go fix(kb): map ErrKnowledgeBaseNotFound to 404 across handler helpers 2026-05-14 20:12:41 +08:00
knowledgebase_pr3_response_test.go feat(knowledge-base): validate vector store bindings on create, copy, and delete 2026-05-18 15:58:46 +08:00
knowledgebase_pr5_list_test.go feat: expose KB ↔ vector store binding in list, editor, and detail UI 2026-05-22 17:40:10 +08:00
knowledgebase_request_test.go feat(knowledge-base): validate vector store bindings on create, copy, and delete 2026-05-18 15:58:46 +08:00
list_pagination.go feat(invitations): implement pending invitations feature with polling and dialog 2026-05-18 17:28:58 +08:00
mcp_credentials.go refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
mcp_service.go fix(initialization): surface upstream and SSRF errors verbatim in test-connection responses 2026-05-17 15:27:52 +08:00
message.go fix(chat): stabilize history pagination and keep message order 2026-05-20 21:03:39 +08:00
message_session_not_found_test.go fix(chat): stabilize history pagination and keep message order 2026-05-20 21:03:39 +08:00
model.go fix: add model display name 2026-05-28 19:22:17 +08:00
model_credentials.go refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
model_test.go fix: add model display name 2026-05-28 19:22:17 +08:00
organization.go feat: expose KB ↔ vector store binding in list, editor, and detail UI 2026-05-22 17:40:10 +08:00
rbac_lookups.go fix(rbac): wire chunk-id ownership chain for generated-question delete 2026-05-18 17:28:58 +08:00
rbac_lookups_test.go fix(rbac): wire chunk-id ownership chain for generated-question delete 2026-05-18 17:28:58 +08:00
skill_handler.go feat: update sandbox service configuration in Docker Compose files 2026-02-04 21:34:07 +08:00
storage_allowlist.go feat(obs): 支持华为云obs存储 2026-05-18 19:38:23 +08:00
system.go feat(system): add server startup time and uptime tracking 2026-06-04 15:48:04 +08:00
system_admin_audit_test.go test(system): cover system.* audit constants + emitAdminAudit contract 2026-05-26 21:13:56 +08:00
tag.go refactor(rbac): KB-access guard at the route layer (no helper in handlers) 2026-05-18 17:28:58 +08:00
tenant.go feat(system): consolidate system admin and settings into one Settings panel 2026-05-26 21:13:56 +08:00
tenant_invitation.go feat(rbac): add multi-use share-link invitations for invite_only mode (#1504) 2026-05-27 19:42:01 +08:00
tenant_invite_link.go feat(rbac): add multi-use share-link invitations for invite_only mode (#1504) 2026-05-27 19:42:01 +08:00
tenant_member.go feat(invitations): implement pending invitations feature with polling and dialog 2026-05-18 17:28:58 +08:00
tenant_member_test.go feat(invitations): implement pending invitations feature with polling and dialog 2026-05-18 17:28:58 +08:00
user_resource_favorite.go feat(favorites): implement user favorites and recents functionality 2026-05-18 17:28:58 +08:00
vectorstore.go fix: validate vector store connection addresses against SSRF policy 2026-06-04 15:26:56 +08:00
web_search.go docs(api): add and fix swag annotations on handlers 2026-05-12 13:16:58 +08:00
web_search_provider.go refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
web_search_provider_credentials.go refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
wechat_qrcode.go docs(api): add and fix swag annotations on handlers 2026-05-12 13:16:58 +08:00
weknoracloud.go docs(api): add and fix swag annotations on handlers 2026-05-12 13:16:58 +08:00
wiki_page.go fix(swagger): Fix some Swagger API endpoints returning 404 errors and regenerate the Swagger documentation 2026-05-21 21:13:40 +08:00