Dashboard: a successful response whose JSON does not parse is treated as an empty success

オープン 初心者向け
#1,039 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
frontend

調査の方向性

まず frontend/src/services/api.ts の readSuccessBody 周辺と、その直上にある非 JSON のエラーブランチを読みます。空の 204/205 応答が別々に処理されていることを確認し、その後、破損した JSON のパスが同じ種類のパス固有の ApiError を発生させるように変更します。関連するフロントエンドサービスのテストで検証し、本文が切り詰められているか無効な 2xx JSON 応答も含めます。

索引モデルが issue の本文から書いたものです。

説明

bug post-launch

readSuccessBody in frontend/src/services/api.ts (lines ~370-375) returns undefined when a 2xx response with a JSON content type has a body that does not parse:

try {
  return (await response.json()) as T;
} catch {
  return undefined as T;
}

So a truncated or malformed successful body is treated as a successful empty result. The caller then shows success, or fails later on a property of undefined with a message that does not say what went wrong. Empty 204/205 responses are already handled before this point and are not affected.

Expected: a body that the content type says is JSON but that does not parse raises an ApiError naming the path (as the non-JSON branch above already does), so the page shows a clear error. Found in a code review (2026-10-06); no user report.

主要言語
Python
スター
0
フォーク
4
平均マージ
5時間 19分
マージ済み PR(30日)
503

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Controlvar/controlvar のほかの issue

Controlvar/controlvar の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。