Sample finish_uploading_large_file uses the wrong sha1 and fails its resume check

Aberta
#249 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 3 dias

@MatheoPaiva já está trabalhando nisso.

Desde 15/11/2026.

  • #262 de @MatheoPaiva — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
Menos de uma hora
Facilidade para iniciantes
25/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
java
Domínio
api

Direção de pesquisa

Start with the setSha1 call at samples/src/main/java/com/backblaze/b2/sample/B2.java lines 576-579, then the resume check at core/src/main/java/com/backblaze/b2/client/B2LargeFileUploader.java line 127, which compares against getLargeFileSha1OrNull(). Open PR #262 already targets this, so review that before writing a patch. Done means the sample passes the value the check expects, so resume no longer fails with mismatch.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

What happens

The finish_uploading_large_file sample command sets the content source's sha1 from largeFileVersion.getContentSha1(). For a large file the server reports none there, while the resume check compares the source sha1 with the stored large_file_sha1 info value. The check then rejects the resume with a mismatch error.

Where

samples/src/main/java/com/backblaze/b2/sample/B2.java:576-579 (.setSha1(largeFileVersion.getContentSha1())); the check is at core/src/main/java/com/backblaze/b2/client/B2LargeFileUploader.java:127; the SDK itself notes that sha1 is none for large files at core/src/main/java/com/backblaze/b2/client/contentHandlers/B2ContentWriter.java:152.

Why it matters

Impact: Docs and messages (a sample command that does not work), loud. Severity: Low, because it only affects a sample command and fails with a clear error, and nothing is harmed.

How to check

Found by reading the code, not reproduced. Read the sample and the check: the check compares against getLargeFileSha1OrNull(), but the sample passes getContentSha1(). Using getLargeFileSha1OrNull() or computing the sha1 from the local file would match.

Version

Seen at v6.5.0. Present on the default branch: present.

Linguagem predominante
Java
Estrelas
103
Forks
23
Merge médio
5d 8h
PRs com merge (30d)
3

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Backblaze/b2-sdk-java

Todas as issues de Backblaze/b2-sdk-java

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.