admin2: Implement type verification for changing resource settings
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Lua
- スター
- 185
- フォーク
- 180
- 平均マージ
- 5日 13時間
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
multitheftauto/mtasa-resources のほかの issue
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
multitheftauto/mtasa-resources#697 · コメント 7 件 · リアクション 7 件 ·
-
editor: LOD_MAP table is missing some LOD models再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 36/100
-
enhancement resource:editor
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
multitheftauto/mtasa-resources#388 · リアクション 3 件 ·
-
help wanted waiting for feedback
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
multitheftauto/mtasa-resources#361 · コメント 8 件 · リアクション 8 件 ·
-
enhancement resource:editor
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
multitheftauto/mtasa-resources#262 · リアクション 1 件 ·
multitheftauto/mtasa-resources の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
teradata-labs/loom#624 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rohit746/pdf-view.nvim#109 ·
メンテナーはふだん 1 日以内に返信
-
bug guide
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信