Include standard error/code/timestamp fields on 409 responses from /api/docker-containment routes
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker, express, javascript, react
調査の方向性
featureOff ヘルパーと、server/routes/dockerContainment.js の拒否分岐(31〜37行目、48行目、62行目付近)から始めて、それらが返す 409 のレスポンスボディと比較してください。次に、client/src/services/apiDockerContainment.js が apiCore.js の throwApiError を通じてエラーをどのように受け渡しているかを確認してください。/pull と /run からの 409 拒否に error、code、timestamp が含まれ、既存の status、reason、state、contained フィールドが維持され、server/routes/dockerContainment.test.js がこれを検証していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
server/routes/dockerContainment.js:31-37 (featureOff) and server/routes/dockerContainment.js:62 (refusal from runContained) return HTTP 409 JSON bodies carrying { status: 'refused', code: 'CONTAINMENT_UNAVAILABLE', state, reason, contained: false } with no error or timestamp field. The UI caller pullDockerContainmentImage (client/src/services/apiDockerContainment.js:18-19, invoked from client/src/components/settings/DockerContainmentCard.jsx:40-43) goes through apiCore.js request() -> throwApiError() (client/src/services/apiCore.js:56), which reads error.error || 'HTTP ' + response.status. On a 409 featureOff response, error.error is undefined so the UI toasts "HTTP 409". Similarly, failed POST /pull responses at line 48 omit code and timestamp.
Impact
If Docker containment is disabled in another tab before the operator clicks "Pull image", DockerContainmentCard.jsx:43 toasts raw "HTTP 409" instead of "Docker containment is off. Turn it on in Settings > Features first.", and any apiCore.js caller receives no .error string on 409 refusals.
Decided Fix
Include error: reason and timestamp: Date.now() in featureOff (server/routes/dockerContainment.js:31-37), and ensure 409 payloads in POST /pull (line 48: include code: CONTAINMENT_UNAVAILABLE and timestamp: Date.now() when !result.ok) and POST /run (line 62: include error: result.reason and timestamp: Date.now() when result.status === 'refused') carry the standard error/code/timestamp keys without removing the existing status/reason/state/contained fields consumed by scripts/contained-run.js. Add assertions in server/routes/dockerContainment.test.js.
Affected Files
server/routes/dockerContainment.jsserver/routes/dockerContainment.test.jsclient/src/services/apiDockerContainment.jsclient/src/components/settings/DockerContainmentCard.jsx
Acceptance Criteria
-
featureOffinserver/routes/dockerContainment.js:31-37and refusal responses returned with HTTP 409 fromPOST /api/docker-containment/pullandPOST /api/docker-containment/runincludeerror(set to the refusal reason) andtimestampalongside the existing{ status, code, state, reason, contained }fields. -
pullDockerContainmentImage(client/src/services/apiDockerContainment.js:18-19) surfaces the refusal message viathrowApiErrorsoDockerContainmentCard.jsx:43toasts the real reason instead of'HTTP 409'. -
server/routes/dockerContainment.test.jsverifieserror,code, andtimestampon 409 refusals while keeping all existing assertions forscripts/contained-run.jsgreen.
Origin: PortOS api-contract baseline audit (2026-11-24) · Severity: 4/10
- 主要言語
- JavaScript
- スター
- 38
- フォーク
- 32
- 平均マージ
- 20分
- マージ済み PR(30日)
- 996
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
atomantic/PortOS のほかの issue
-
area:media bug effort:low in-progress model:light plan planner:gemini-4-neon-high reliability-error-handling
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
area:create bug effort:low feature-completeness in-progress model:light plan planner:gemini-4-neon-high
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Pin Hugging Face commit revisions for AuK weight downloads and eliminate post-download SHA TOCTOUオープンarea:voice better-dependency-freedom dependencies effort:low in-progress model:medium plan planner:gemini-4-neon-high priority:2 security
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
api-contract area:cos-agents effort:low in-progress model:light plan planner:gemini-4-neon-high
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area:calendar area:ui design-usability effort:low in-progress model:light plan planner:gemini-4-neon-high priority:2 ux
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
atomantic/PortOS の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
cloudflare/workers-sdk#17139 ·
メンテナーはふだん 1 日以内に返信
-
area: editor P3 type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
halisonworks/mod-codeling#290 ·
メンテナーはふだん 1 日以内に返信
-
Teams conversion crashes on channel messages sent by an application対応中かも @sdivyanshu90 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aws/aws-sdk-js-v3#8441 ·
メンテナーはふだん 1 日以内に返信