admin2: Implement type verification for changing resource settings
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Lua
- Star
- 185
- Fork
- 180
- Merge trung bình
- 5 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của multitheftauto/mtasa-resources
-
new resource: map_loaderĐang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
multitheftauto/mtasa-resources#697 · 7 bình luận · 7 reaction ·
-
editor: LOD_MAP table is missing some LOD modelsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 36/100
-
New features to Map EditorĐang mởenhancement resource:editor
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
multitheftauto/mtasa-resources#388 · 3 reaction ·
-
help wanted waiting for feedback
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
multitheftauto/mtasa-resources#361 · 8 bình luận · 8 reaction ·
-
enhancement resource:editor
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
multitheftauto/mtasa-resources#262 · 1 reaction ·
Tất cả issue của multitheftauto/mtasa-resources
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
teradata-labs/loom#624 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
rohit746/pdf-view.nvim#109 ·
Maintainer thường phản hồi trong vòng 1 ngày