admin2: Implement type verification for changing resource settings
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Lua
- Stelle
- 185
- Fork
- 180
- Merge medio
- 5g 13h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di multitheftauto/mtasa-resources
-
new resource: map_loaderApertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
multitheftauto/mtasa-resources#697 · 7 commenti · 7 reazioni ·
-
editor: LOD_MAP table is missing some LOD modelsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaenhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 36/100
-
New features to Map EditorApertaenhancement resource:editor
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
multitheftauto/mtasa-resources#388 · 3 reazioni ·
-
help wanted waiting for feedback
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
multitheftauto/mtasa-resources#361 · 8 commenti · 8 reazioni ·
-
enhancement resource:editor
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
multitheftauto/mtasa-resources#262 · 1 reazione ·
Tutte le issue di multitheftauto/mtasa-resources
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rohit746/pdf-view.nvim#109 ·
I maintainer di solito rispondono entro 1 giorno
-
bug guide
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement forever
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
openmap-world/openmap#78 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AndyHazz/bookends.koplugin#130 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
carlos-algms/agentic.nvim#336 ·