Resuming a large file is refused when its fileInfo carries large_file_sha1

Offen
#223 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 3 Tagen

@ffumero2003 arbeitet bereits daran.

Seit 29.10.2026.

  • #232 von @sophiecarreras — offen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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.
Vorherrschende Sprache
Java
Sterne
103
Forks
23
Ø Merge
5 T. 8 Std.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Backblaze/b2-sdk-java

Alle Issues in Backblaze/b2-sdk-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.