Resuming a large file is refused when its fileInfo carries large_file_sha1

未关闭
#223 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 3 天内回复

@ffumero2003 已经在做这个了。

开始于 2026年10月29日。

  • #232 来自 @sophiecarreras —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

bug

Problem

When resuming a large file, B2LargeFileUploader checks that the unfinished file's fileInfo matches the request. It removes the SDK-added whole-file SHA-1 before comparing:

// core/src/main/java/com/backblaze/b2/client/B2LargeFileUploader.java:141
infos.remove(B2Headers.LARGE_FILE_SHA1);

B2Headers.LARGE_FILE_SHA1 is the header name X-Bz-Info-large_file_sha1 (B2Headers.java:50), but the map is keyed by the file-info name large_file_sha1 (B2Headers.LARGE_FILE_SHA1_INFO_NAME, :49). The remove never matches, so the comparison at :142 fails and a resume is refused whenever the original upload carried a SHA-1, even when the request is identical to the one that started the file.

Expected vs. actual

  • Expected: resuming with the same request that started the large file continues the upload.
  • Actual: throwIfMismatch("fileInfo", ...) rejects it when a SHA-1 is known. Resume without a SHA-1 works.

Acceptance criteria

  • Remove B2Headers.LARGE_FILE_SHA1_INFO_NAME instead of B2Headers.LARGE_FILE_SHA1.
  • A unit test that resumes an unfinished file whose fileInfo contains large_file_sha1 with the same request, and asserts no mismatch is thrown; and that a different non-SHA-1 file-info value is still rejected.
主要语言
Java
星标
103
派生
23
平均合并
5 天 8 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Backblaze/b2-sdk-java 的其他 Issue

查看 Backblaze/b2-sdk-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。