Repository navigation
fix(upload): show multipart storage errors and verify vanished sessions - #725
Open
thetapilla wants to merge 2 commits into
Open
thetapilla wants to merge 2 commits into
thetapilla wants to merge 2 commits into
Conversation
- When a chunk is rejected because the upload attempt failed, show the storage's error carried in the session snapshot instead of the generic envelope message. Servers that predate reporting the cause only said "multipart upload window closed" there. Co-Authored-By: Claude <noreply@anthropic.com>
…cess - When the complete response is lost and the session is then gone, the uploader took the 404 as success. Completed sessions are reaped that way, but so are superseded and aborted ones. Check that the destination exists with the uploaded size before reporting success, and fail otherwise. Co-Authored-By: Claude <noreply@anthropic.com>
15 of 25 tasks
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.
Summary / 摘要
修复分块上传失败时上传列表只显示
multipart upload window closed,以及会话"消失"时误报上传成功的问题。用户可感知的变化:
multipart upload window closed([BUG] windows7构建版在Windows Server 2012上表单上传报错 multipart upload window closed OpenList#3309 截图中的报错)。真实原因原本就在响应的会话快照里,所以对现有版本的服务端同样有效/complete的响应丢失、之后会话已不存在时,先确认目标文件存在且大小一致才判定成功,否则报upload session ended before completion实现要点:
failed*时显示data.error,否则沿用messagefsGet查询目标文件;查询本身遇到网络抖动则继续轮询。已完成的会话会这样被回收,被取代或中止的会话也会,所以 404 本身不能证明上传成功兼容性说明:上述检查只在
/complete的响应丢失时才执行。在列表更新滞后于上传的存储上,它可能把实际成功的上传报为失败;相比把没传上去的文件报为成功,这样更稳妥。/ 此 PR 包含破坏性变更。
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。
/ 此 PR 需要关联仓库同步修改。
Related repository PRs / 关联仓库 PR:
Related Issues / 关联 Issue
Relates to OpenListTeam/OpenList#3309
Testing / 测试
测试平台:macOS arm64,Node 26 / pnpm 10。
go test ./...不适用前端仓
自动化检查:
pnpm test(40/40)、pnpm build通过pnpm lint(tsc):本 PR 未引入新的类型错误(仓库现存 13 个与本 PR 无关的既有错误,main 上同样存在)multipart.ts配合模拟服务端跑场景测试(不含在本 PR 中):分片失败时显示存储错误;会话消失时,目标文件存在且大小一致判成功、大小不一致判失败,且只查询一次;原有场景在新旧代码上都通过浏览器实测:
/complete的响应:文件已在时判成功;完成后立即删除文件时报upload session ended before completion说明:main 的
pnpm-lock.yaml缺katex@0.18.2条目,pnpm install --frozen-lockfile会失败(#639 之后 main 的 Rolling Build 也因此失败),本 PR 的 CI 可能在安装依赖一步失败。本 PR 不涉及依赖,本地以--no-frozen-lockfile安装后测试,lockfile 未提交。Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认此贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者或代码所有者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Refactoring / 重构
Documentation / 文档
Tests / 测试
Translation / 翻译
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
/ 我已审核并验证此 PR 中的所有 AI 辅助内容。
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。I can reproduce all AI-assisted content included in this PR without any AI tools.
/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。