decodeListing reports truncated listings as errors on Go 1.27
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
Línea de trabajo
Read internal/files/lister.go around decodeListing at line 459 and the TestDecodeListingByteCap case in decode_internal_test.go. Reproduce the behavior with the Go versions described in the issue, then check how reaching the byte cap affects decode errors. Done when the test treats a capped listing as truncated without returning the unexpected end of JSON input error.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
TestDecodeListingByteCap fails on Go 1.27 and passes on the pinned toolchain (go1.26.11), so main is fine today and this will break when the toolchain moves.
--- FAIL: TestDecodeListingByteCap/entry_boundary
decode_internal_test.go:29: got 1 entries, truncated false, err unexpected end of JSON input
decodeListing treats a cut-off body as truncated only when the error is io.EOF or io.ErrUnexpectedEOF (internal/files/lister.go:459). On Go 1.27, encoding/json's Decoder reports running out of input as *json.SyntaxError "unexpected end of JSON input", and More() returns true at that point instead of false. A small probe reading {"list":[{"Name":"a"} and then calling Token():
go1.26.11: More: false Token: *errors.errorString EOF
go1.27.4: More: true Token: *json.SyntaxError unexpected end of JSON input
So a listing that hits the byte cap comes back as an error instead of a truncated listing. Since lr.N <= 0 already says the cap was hit, the fix could be to treat any decode error after the limit is reached as truncation, rather than matching on the error type.
I hit this because my machine runs with GOTOOLCHAIN=local, so the toolchain line was ignored.
- Lenguaje dominante
- Go
- Estrellas
- 5
- Forks
- 0
- Merge medio
- 21 h 13 min
- PR fusionados (30 d)
- 53
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nebari-dev/tapas
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
nebari-dev/tapas#124 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nebari-dev/tapas#121 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
nebari-dev/tapas#32 ·
Los mantenedores suelen responder en 1 día
-
Suggest saving a memory when a chat message holds something worth rememberingPosiblemente ocupada @jbouder la tomó hoy. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
nebari-dev/tapas#137 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 54/100
nebari-dev/tapas#136 ·
Los mantenedores suelen responder en 1 día
Todos los issues de nebari-dev/tapas
Issues similares
-
--auto-tier: hashing, dedup, resume validation and DVC/git reads still update atime on LinuxAbiertoarea: pipeline priority: low type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
prime-radiant-inc/evener#8335 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
ui: OnTextKey on SearchField never sees keys (it does not reach the inner input)Posiblemente ocupada @szluyu99 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100