feat: 支持知识库文件批量上传与状态跟踪 - #56
Merged
Snailclimb merged 3 commits intoSep 16, 2026
Merged
Conversation
- 拆分文件选择、上传列表和批量上传 Hook,支持单批最多 10 个文件及自定义知识库名称 - 校验文件格式、大小和重复选择,以双并发和请求间隔批量提交 - 轮询向量化进度并展示各阶段状态,支持上传失败重试和重新向量化 - 增加文件校验、队列并发和状态映射测试
- 引入共享限速队列,限制并发与启动间隔,并允许上传期间继续追加文件 - 隔离单项失败并区分待提交、排队、上传和向量化状态,避免任务重复入队 - 增加上传重试冷却、逐项状态轮询和组件卸载资源清理 - 覆盖跨批次去重、文件数量上限、动态追加和失败不中断场景
Snailclimb
approved these changes
Sep 16, 2026
Snailclimb
left a comment
Owner
There was a problem hiding this comment.
这版实现符合 #52 里约定的范围,本轮审查未发现阻塞性的功能问题,代码审查通过。共享队列限制并发和发送节奏,上传与向量化分别重试,也没有扩大后端改动范围。
已验证:
- 新增批量上传测试 5/5 通过,现有四组前端测试 13/13 通过。
pnpm run build通过。- 使用真实 Chrome、模拟 API 响应验证了多文件选择/拖拽、上传期间追加文件、并发上限 2、请求启动间隔、自定义名称、单文件失败不影响后续文件、上传重试、向量化重试和重复文件提示;未发现浏览器运行时异常。这部分没有连接真实对象存储和向量化服务。
- 已批准运行此前等待维护者授权的 GitHub Actions;前端 CI 已通过,后端 CI 仍在运行,合并前需要确认全部检查通过。
有一项非阻塞建议:把新增的 pnpm run test:knowledge-base-upload 接入 .github/workflows/ci.yml 的前端测试步骤。目前 CI 只执行原有四组测试,构建也不会运行这 5 个测试,后续队列逻辑回归可能漏检。
PR 先保持 Draft。你确认这一轮完成后可以转为 Ready for review,等 CI 全绿再合并。感谢贡献!
Contributor
Author
|
已按建议将 pnpm run test:knowledge-base-upload 接入 .github/workflows/ci.yml 的前端测试步骤。本地已验证五组前端测试全部通过,前端构建成功。 |
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.
概要
为知识库上传页面增加批量上传能力,支持多文件选择和拖拽、前端队列调度、逐文件状态跟踪及失败重试。
本 PR 仅修改前端,继续复用现有的单文件上传、知识库查询和重新向量化接口,不新增后端批量接口,也不调整数据库、Redis Stream 或服务端限流配置。
变更内容
批量选择与文件校验
上传队列与请求节奏
状态跟踪与失败恢复
revectorize接口重新处理代码组织与测试
范围说明
验证
node --test src/pages/knowledgeBaseBatchUpload.test.ts:5 个测试全部通过npm run build:前端生产构建通过关联 Issue
Closes #52