decodeListing reports truncated listings as errors on Go 1.27
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 5
- フォーク
- 0
- 平均マージ
- 21時間 13分
- マージ済み PR(30日)
- 53
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nebari-dev/tapas のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
nebari-dev/tapas#124 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nebari-dev/tapas#121 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nebari-dev/tapas#32 ·
メンテナーはふだん 1 日以内に返信
-
Suggest saving a memory when a chat message holds something worth remembering対応中かも @jbouder が今日担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
nebari-dev/tapas#137 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
nebari-dev/tapas#136 ·
メンテナーはふだん 1 日以内に返信
nebari-dev/tapas の issue をすべて見る
似ている issue
-
area: pipeline priority: low type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
prime-radiant-inc/evener#8335 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
ui: OnTextKey on SearchField never sees keys (it does not reach the inner input)対応中かも @szluyu99 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100