admin2: Implement type verification for changing resource settings
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by locating admin2’s resource settings update flow and the default resources’ meta.xml entries that define the accept attribute; the issue names no file or test. Check how set() handles values and compare the existing type declarations across resources. Done means settings are validated against consistent supported types and the default resources declare their expected types; the issue also suggests checking whether admin1 has the same problem.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
Recently I've gotten myself in a frustrating situation when I attempted to change a setting of the freeroam resource via admin2. Parts of freeroam stopped working as it expected a table in that setting and even using correct JSON formatting admin2 set the setting as a string. A user shouldn't be able to break parts of default resources like this, especially with no easy way to undo the damage in clear sight. The way set() behaves makes it to neither restarting the resource or changing the setting in the resources meta.xml will actually help you get back to normal.
Describe the solution you'd like
Settings already often have a 'accepted' attribute, however it's not even used consistently within default resources. My desired solution would implement some sort of type checking and update all existing default resources to properly define what type of value they expect.
Describe alternatives you've considered
For the more savvy users converting properly JSON formatted values before applying the setting would be enough, however I believe we can do better.
A 'restore default' button would also be the very least we can offer.
Additional context
The main problem is that there is no standardized nomenclature for the 'accept' attribute. Some use 'bool', others 'boolean', then there are some that list possible values like 'true,false', some will say 'float' or 'int' while others say 'positive number'. It's gonna be impossible to suit every single use perfectly. At the very least the default lua types 'boolean' 'number' 'string' and 'table' should be supported, but I believe there is room to catch some of the commonly used nomenclature variants like 'true/false' and add some basic functionality to be able to verify if a value is a 'positive number', within the range of '0-100' or whether a string is shorter than 32 characters.
[Pending testing] I believe admin1 currently has the same issue.
- Lenguaje dominante
- Lua
- Estrellas
- 185
- Forks
- 180
- Merge medio
- 5 d 13 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 multitheftauto/mtasa-resources
-
new resource: map_loaderAbiertoenhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
multitheftauto/mtasa-resources#697 · 7 comentarios · 7 reacciones ·
-
editor: LOD_MAP table is missing some LOD modelsQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 36/100
-
New features to Map EditorAbiertoenhancement resource:editor
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
multitheftauto/mtasa-resources#388 · 3 reacciones ·
-
help wanted waiting for feedback
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
multitheftauto/mtasa-resources#361 · 8 comentarios · 8 reacciones ·
-
enhancement resource:editor
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
multitheftauto/mtasa-resources#262 · 1 reacción ·
Todos los issues de multitheftauto/mtasa-resources
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
teradata-labs/loom#624 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rohit746/pdf-view.nvim#109 ·
Los mantenedores suelen responder en 1 día
-
bug guide
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
enhancement forever
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
openmap-world/openmap#78 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
PathOfBuildingCommunity/PathOfBuilding#10420 ·
Los mantenedores suelen responder en 8 días