[Bug]: updateUser saves part of an edit when a later field fails
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start by reading src/api/users.rs lines 213-254, where updateUser writes username, admin flag and permissions one by one and only checks the new password at the end. Then look at how other handlers in the repo open a transaction and do the admin-count check. Done means all validation happens before any write, and the writes plus admin check run in one transaction, with a test showing a rejected password leaves the rename unsaved.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.
Version
0.40.0 (feat/desktop, 017a837b)
Area
Other
What happened?
updateUser writes the username, admin flag and permissions one by one, and only validates the new password at the end (src/api/users.rs:213–src/api/users.rs:254). A too-short password returns an error but the other changes are already saved. Nothing runs in a transaction, so two admins demoting each other at once can both pass the "at least one admin" check.
Steps to reproduce
Rename a user and set a 3-character password in the same edit: you get an error, but the rename went through.
Expected behavior
Either the whole edit applies or none of it does.
Suggested fix
Validate every field before writing anything, and do the writes (including the admin count check) in one transaction.
- Lenguaje dominante
- TypeScript
- Estrellas
- 4
- Forks
- 1
- Merge medio
- 4 h 49 min
- PR fusionados (30 d)
- 5
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin 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 tinystream-dev/tinystream
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tinystream-dev/tinystream#132 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tinystream-dev/tinystream#131 ·
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
tinystream-dev/tinystream#129 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
tinystream-dev/tinystream#128 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
tinystream-dev/tinystream#124 ·
Todos los issues de tinystream-dev/tinystream
Issues similares
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
sandbox-quantum/switch#2163 ·
Los mantenedores suelen responder en 1 día
-
automated issue report
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area/dashboard kind/bug QA/dev-automation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
bug pydanty:is-working
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
pydantic/pydantic-ai#13939 ·
Los mantenedores suelen responder en 1 día
-
self-host
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
funmusicplace/mirlo#2625 ·
Los mantenedores suelen responder en 1 día