Resuming a large file is refused when its fileInfo carries large_file_sha1

Đang mở
#223 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@ffumero2003 đang làm issue này rồi.

Từ ngày 29/10/2026.

  • #232 của @sophiecarreras — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.
Ngôn ngữ chính
Java
Star
103
Fork
23
Merge trung bình
5 ngày 8 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Backblaze/b2-sdk-java

Tất cả issue của Backblaze/b2-sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.