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

A New signup description with line breaks can pass the form, then be refused as too long

Aperta Adatta ai principianti
#722 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
next.js, react, typescript
Ambito
full-stack

Direzione di ricerca

Leggi createSignupAction e SignupCreateInputSchema per vedere il flusso di dati. Aggiungi un helper vicino all'azione che sostituisce \r\n con \n nella descrizione prima di createSignup, e fissalo con un test unitario. Esegui pnpm lint && pnpm typecheck && pnpm knip && pnpm test; fatto quando un invio di 1,996 lettere, 4 interruzioni, viene salvato con interruzioni \n e tutti i controlli passano.

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

Descrizione

bug pipeline:ready pipeline:ux

What happens

The description box on the New signup form (src/app/app/(chrome)/signups/new/page.tsx) has maxLength 2,000. The browser counts each line break as 1 character. When the form is sent, each line break becomes \r\n, which is 2 characters. createSignupAction passes the text on as it arrives, and SignupCreateInputSchema refuses anything over DESCRIPTION_MAX_LENGTH (2,000).

So a description near the limit with a few paragraph breaks passes in the browser, then the server refuses it with zod's own "String must contain at most 2000 character(s)". The form then comes back empty (#721).

Checked in Chromium: a textarea holding 1,996 letters and 4 line breaks reports a length of 2,000 and is valid. Sent with new FormData(form), the way a server action sends it, the server receives 2,004 characters with 4 \r\n.

Fix, in outline

  • In createSignupAction, turn \r\n into \n in the description before calling createSignup. The browser and the server then count the same way.
  • Put that in a small helper next to the action, so a unit test can pin it.

Watch for

  • The Build tab already saves \n. It sends the textarea's value as JSON, so this makes both paths store the same thing.
  • Leave the schema alone. Don't change DESCRIPTION_MAX_LENGTH or SignupCreateInputSchema. The API, the MCP tools and Magic Compose don't go through this form.
  • #721 changes the same action. Whichever lands second has a small merge.

Done when

  • A description of 1,996 letters and 4 line breaks, sent as the browser sends it (\r\n), creates the signup, and the saved description has 4 \n breaks.
  • A test pins that.
  • pnpm lint && pnpm typecheck && pnpm knip && pnpm test pass.

From the owner's review of #706. Checked against main at 2d4fdfe by reading createSignupAction and SignupCreateInputSchema, and in Chromium as above. Session: https://claude.ai/code/session_016YZ9SUMiUBccns5PMgoNS1

Lingua principale
TypeScript
Stelle
19
Fork
4
Merge medio
23h 28m
PR unite (30g)
173

Preparare l'ambiente

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 richshaw/OpenSignup

Tutte le issue di richshaw/OpenSignup

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.