Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Validate helloAction input on the server before constructing a greeting

オープン
#381 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@xlc がすでに取り組んでいます。

2026年10月15日 から。

  • #388 @xlc による — オープン

評価

難易度
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 の本文から書いたものです。

説明

bug

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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

polka-codes/test のほかの issue

polka-codes/test の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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