A Number field can't be changed to Text or a List without blanking every slot's value first
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Start in updateField in src/services/slot-fields.ts, where it checks each slot's stored value with validateOneValue under the signup lock. The change converts stored numbers with String(n) for Number-to-Text and Number-to-List, then validates the converted values. Tests go in slot-fields.db.test.ts, and the issue says it is waiting on a maintainer decision (pipeline:proposed) and overlaps with #780, so confirm approval first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Needs your OK: this changes what happens when an organizer changes a Number field's type: stored numbers would be turned into text instead of the change being refused. Swap pipeline:proposed for pipeline:ready to have it built.
What happens
updateField in src/services/slot-fields.ts checks every slot's stored value against the field's new type with validateOneValue, and refuses with conflict "change would invalidate existing slot values" if any fails. Number values are stored as JSON numbers, and the text and enum checks require typeof value === 'string'. So a Number field with even one value in it can never become Text or a List.
The organizer can't convert the values first either. While the field is still Number, updateSlot refuses a string (""qty" must be a number"). The only way through is to clear every value, change the type, and type them all in again.
Who hits it:
- The Build tab.
InlineFieldFormoffers every type when editing a field. Changing "Quantity" from Number to Text (to allow "2 dozen") shows the raw server text "change would invalidate existing slot values". - AI assistants. The
update_fieldMCP tool's description says "fix those values with update_slot first". For Number to Text or a List that advice can't work, becauseupdate_slotrefuses the string.
Number to a List fails even when the list's choices include the numbers as strings ('2').
Fix, in outline
- In
updateField, where it already reads the signup's slot rows under the lock: when the field is going fromnumbertotextorenum, convert each stored number withString(n). - Validate the converted values against the new config, not the raw ones. Refuse as today if any still fails (text longer than
maxLength, a number missing from the list's choices). - If they all pass, write the converted
valuesback to those slots in the same transaction as the field update. - Fix the
update_fielddescription only if what it says stops being true.
Watch for
- Don't loosen
validateOneValueto accept numbers in text or list fields. That leaves mixed types inslots.values. - Other refusals stay. Narrowing a list, shortening
maxLength, and Text to Date are refused on purpose (#289). Tests inslot-fields.db.test.tspin them and must keep passing. - Overlap with #780, which changes how
slot-fields.tstakes the signup write lock. Whichever lands second has a small merge. - Help pages. Run the
help-pagesskill'saffected-articles.mjsand update any article that says a type change is refused. - Activity log. If slot values are rewritten, consider whether the field-update activity row should say so. Follow how
updateFieldrecords today.
Choices this makes
- Convert, not refuse. Default: convert Number to Text or a List automatically, because no information is lost. The alternative is a clearer error message only.
- Text to Number stays refused. Default: leave it as is. Parsing "2 dozen" or "1,5" as a number guesses, and a wrong guess changes data silently.
- Number formatting. Default:
String(n)(so2.5becomes"2.5"), not the page's display format. It's predictable and round-trips.
Done when
- A DB test: a Number field with values
2and3.5changes to Text, and the slots now hold"2"and"3.5". - A DB test: Number to a List with choices
['2', '3.5']succeeds and converts. With choices['2']it's refused withconflictand nothing changes. pnpm lint && pnpm typecheck && pnpm knip && pnpm testandpnpm test:dbpass.
Found by the pipeline's bugs scout in the slot field services (src/services/slot-fields.ts, src/mcp/tools/fields.ts), at 8e63fab. Checked by an independent verifier with a scratch DB test: Number to Text and Number to a List were both refused, updateSlot refused the string, and only blanking the value let the change through. https://claude.ai/code/session_016YZ9SUw2vvaNxfSUsArR5B
- Lenguaje dominante
- TypeScript
- Estrellas
- 19
- Forks
- 4
- Merge medio
- 19 h 27 min
- PR fusionados (30 d)
- 199
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de richshaw/OpenSignup
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
richshaw/OpenSignup#794 ·
Los mantenedores suelen responder en 1 día
-
enhancement pipeline:proposed pipeline:ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
richshaw/OpenSignup#654 ·
Los mantenedores suelen responder en 1 día
-
Slot times are shown with their own copy of the HH:MM rule that saving them checksPosiblemente ocupada @novakzx la tomó hoy. Abiertoenhancement good first issue pipeline:ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
richshaw/OpenSignup#805 ·
Los mantenedores suelen responder en 1 día
-
The sign-up dialog decides "See alternatives" with its own copy of the rule behind "Pick another slot."Posiblemente ocupada @dafeiyupola la tomó hoy. Abiertoenhancement good first issue pipeline:ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
richshaw/OpenSignup#803 ·
Los mantenedores suelen responder en 1 día
-
A failed database query logs its parameters, so OAuth tokens and participant details can end up in the logsPosiblemente ocupada @richshaw la tomó hace 1 día. Abiertobug pipeline:building
richshaw/OpenSignup#800 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de richshaw/OpenSignup
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
binding:python bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
coollabsio/orbit#72 ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
bug needs-triage potential-regression
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aws/aws-sdk-js-v3#8408 ·
Los mantenedores suelen responder en 1 día