Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Validate helloAction input on the server before constructing a greeting

Aperta
#381 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@xlc ci sta già lavorando.

Dal 15/10/2026.

  • #388 di @xlc — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
0
Fork
0
Merge medio
12m
PR unite (30g)
6

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di polka-codes/test

Tutte le issue di polka-codes/test

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.