WeKnora/internal/handler
wizardchen 5ffc755e76 fix(knowledge): infer synthesized stage status from parse_status
Pre-tracker historical knowledge has zero rows in
knowledge_processing_spans but parse_status correctly reads
"completed" or "failed". The /spans handler was synthesizing five
"pending" placeholders unconditionally, so legacy completed documents
rendered as if they were stuck waiting in the queue forever.

buildSpanTree now takes parse_status and chooses the placeholder
status accordingly:
- ParseStatusCompleted -> done
- ParseStatusFailed    -> failed
- everything else      -> pending (existing behaviour)

Real rows always take precedence; this only changes what we put in
the gaps. So healthy in-flight parses (parse_status=processing,
some real rows, some still pending) keep showing pending placeholders
exactly as before — the synthesized "completed" inference only fires
when the parse already hit terminal state.

Adds TestBuildSpanTree_LegacyCompletedRendersAsDone covering both
the completed-legacy and failed-legacy branches.
2026-05-28 15:14:45 +08:00
..
dto refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +08:00
session feat(system): consolidate system admin and settings into one Settings panel 2026-05-26 21:13:56 +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(system): consolidate system admin and settings into one Settings panel 2026-05-26 21:13:56 +08:00
knowledge.go fix(knowledge): infer synthesized stage status from parse_status 2026-05-28 15:14:45 +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 feat: expose KB ↔ vector store binding in list, editor, and detail UI 2026-05-22 17:40:10 +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(initialization): surface upstream and SSRF errors verbatim in test-connection responses 2026-05-17 15:27:52 +08:00
model_credentials.go refactor(credentials): introduce /credentials subresource pattern 2026-05-17 15:27:52 +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): consolidate system admin and settings into one Settings panel 2026-05-26 21:13:56 +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 feat: add VectorStore CRUD API endpoints and documentation 2026-04-14 17:34:57 +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