500 responses send Prisma's error text to the client
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start by reading ErrorHandler and the PrismaClientKnownRequestError branch, then inspect StudiesController.ts for plain Errors whose messages are intended for users. Update the handling so client responses do not expose error details while user-facing messages use UnprocessableError; log errors server-side. Done means the described 500 responses no longer expose query data or internal error text.
索引モデルが issue の本文から書いたものです。
説明
ErrorHandler ends with a catch-all that returns { message: 'Internal Server Error', details: err.message } for any error it doesn't recognise, so Prisma's own error text goes to the client. #880 sanitised the 422 ValidateError branch for #879, but not this one.
For example, PATCH /profiles/current with a key the request type allows but the profile table doesn't have, such as password, returns a 500 whose details is Prisma's dump of the query: the values sent, including the password, and every column the model accepts. logger.error writes the same text to the logs. The PrismaClientKnownRequestError branch returns err.meta as details for every code, and err.message for codes other than P2002 and P2025.
Fix: return a fixed message with no details from both branches, and log the error on the server instead. First turn the plain Errors that carry a message meant for users into UnprocessableError, such as "Study with that name already exists" in StudiesController.ts, because the admin portal shows that text from the 500's details today.
Related: #879, #880, #418, #919, #943.
- 主要言語
- TypeScript
- スター
- 4
- フォーク
- 0
- 平均マージ
- 14時間 50分
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Garvan-Data-Science-Platform/ctrl のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
-
admin-client backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Garvan-Data-Science-Platform/ctrl#970 · コメント 1 件 ·
-
backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
backend bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Garvan-Data-Science-Platform/ctrl の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vercel/streamdown#673 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
docs(stream-protocol): document messageMetatadata on start/finish and the message-metadata chunk対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンfactory-active task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
agilepathway/label-checker#721 ·
メンテナーはふだん 1 日以内に返信
-
CLI Empathy needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
chromaui/chromatic-cli#1524 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信