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

Abierto Apto para principiantes
#722 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@richshaw ya está trabajando en esto.

Desde el 31/10/2026.

  • #745 de @richshaw — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
85/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
next.js, react, typescript
Área
full-stack

Línea de trabajo

Lee createSignupAction y SignupCreateInputSchema para ver el flujo de datos. Añade un helper junto a la acción que reemplace \r\n con \n en la descripción antes de createSignup, y fíjalo con una prueba unitaria. Ejecuta pnpm lint && pnpm typecheck && pnpm knip && pnpm test; hecho cuando una presentación de 1,996 letras y 4 saltos se guarda con saltos \n y todas las comprobaciones pasan.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug pipeline:building 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

Lenguaje dominante
TypeScript
Estrellas
19
Forks
4
Merge medio
22 h 45 min
PR fusionados (30 d)
193

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de richshaw/OpenSignup

Todos los issues de richshaw/OpenSignup

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.