Validate helloAction input on the server before constructing a greeting
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
Start with the unvalidated argument in src/actions/hello-action.ts, then read the existing minimum-length Zod check in src/components/form.tsx to see how the client currently handles failure. Add server-side validation that rejects non-strings and strings under three characters before any greeting is built, and return a documented error result the form can display. Done means focused Jest tests call the action directly for valid names, empty, short, null and non-string inputs, and the form shows the error without a success toast.
索引モデルが issue の本文から書いたものです。
説明
Context
Current main still accepts the client-controlled argument in helloAction without runtime validation. src/actions/hello-action.ts:1–4 interpolates its argument directly; the TypeScript string annotation does not validate network input. The minimum-three-character Zod check exists only in the client component (src/components/form.tsx:15–17). Direct action invocations bypass that check.
Related history: #368 recorded this finding but was closed as a run-owned QA fixture. Its cleanup comment says implementation PR #369 was closed unmerged. This is a durable follow-up for the still-present gap on main, not a request to reopen the disposable fixture. No matching open issue was found.
Reproduction
Call the action directly with a string shorter than three characters; it constructs a successful greeting despite the form's minimum-length rule. Non-string values are not checked at runtime either. This is source-confirmed; no requests or tests were executed during discovery.
Scope / implementation surface
Validate input at the server boundary in src/actions/hello-action.ts; update src/components/form.tsx only as needed to handle the chosen validation result. Consider sharing the existing schema to prevent client/server drift. Add focused action tests using existing Jest conventions. Keep valid greeting output unchanged; do not add authentication requirements or unrelated form redesign.
Acceptance criteria
- Direct calls reject non-string input and strings shorter than three characters before constructing a greeting.
- Valid names retain the existing successful greeting contract.
- Invalid input produces a deliberate, documented error/result contract, and the form handles it without an unhandled rejection or a success toast.
- Focused tests call the action directly, covering valid names, empty/short strings, null, and representative non-string values rather than relying on client validation.
Validation and dependencies
Run focused Jest coverage, the full unit suite, and the configured typecheck. Use no live services or credentials. No external blocker is known. Coordinate schema/result changes with the form caller.
created by polka.codes
- 主要言語
- TypeScript
- スター
- 0
- フォーク
- 0
- 平均マージ
- 12分
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
polka-codes/test のほかの issue
-
Return an explicit error response from the Stripe webhook outer catch対応中かも @xlc が 15 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
polka-codes/test#382 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
polka-codes/test#361 ·
メンテナーはふだん 1 日以内に返信
-
Expand homepage browser coverage beyond the document title対応中かも @xlc が 15 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
polka-codes/test#349 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 1/100
polka-codes/test#366 ·
メンテナーはふだん 1 日以内に返信
-
Add focused tests for Stripe webhook validation and subscription handling対応中かも @xlc が 15 日前に担当しました。 オープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
polka-codes/test#348 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
polka-codes/test の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
components-web-app/docs#307 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
localstack/localstack-mcp-server#112 ·
メンテナーはふだん 1 日以内に返信
-
area:frontend kind:bug priority:p1 ready
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
PhyberApex/kuroshiro#1687 ·
メンテナーはふだん 1 日以内に返信
-
Performance (Web Vitals) collector: LCP/FCP from background tabs are not discarded, inflating p75オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
umami-software/umami#4720 ·
メンテナーはふだん 3 日以内に返信