Sample finish_uploading_large_file uses the wrong sha1 and fails its resume check

Abierto
#249 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

@MatheoPaiva ya está trabajando en esto.

Desde el 15/11/2026.

  • #262 de @MatheoPaiva — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
java
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Java
Estrellas
103
Forks
23
Merge medio
5 d 8 h
PR fusionados (30 d)
3

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Backblaze/b2-sdk-java

Todos los issues de Backblaze/b2-sdk-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.