Resuming a large file is refused when its fileInfo carries large_file_sha1

Aperta
#223 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@ffumero2003 ci sta già lavorando.

Dal 29/10/2026.

  • #232 di @sophiecarreras — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.
Lingua principale
Java
Stelle
103
Fork
23
Merge medio
5g 8h
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Backblaze/b2-sdk-java

Tutte le issue di Backblaze/b2-sdk-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.