-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
未対応エンジン追加時にリストが消える件(#1168) #1179
Conversation
・追加されたエンジンが未対応である場合には追加を阻止 ・追加されてしまっている場合には、エラーで処理中断しないように
@@ -261,7 +261,7 @@ | |||
</div> | |||
<div class="no-wrap q-pl-md"> | |||
<div class="text-h6 q-ma-sm">機能</div> | |||
<ul v-if="engineManifests[selectedId]"> | |||
<ul v-if="engineManifests[selectedId].supportedFeatures"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここちょっとややこしいのですが、engineManifests[selectedId]
がundefinedになる可能性があったりします。(未知のengineIdがあった場合など)
このとき. supportedFeatures
がエラーになってしまって別の不具合になるかもです!
こういうときjavascriptは便利な記法があって、こう書くと大丈夫なはずです。
<ul v-if="engineManifests[selectedId].supportedFeatures"> | |
<ul v-if="engineManifests[selectedId]?.supportedFeatures"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
その記法、ESLintでしばってませんでしたっけ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あ、そうでしたっけ。。。となるとこうですかね。。(npm run fmtが必要そう)
<ul v-if="engineManifests[selectedId].supportedFeatures"> | |
<ul v-if="engineManifests[selectedId] && engineManifests[selectedId].supportedFeatures"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビューありがとうございます。
この部分のループで使われる selectedId が engineIcons (≒engineManifests)から生成されるので
「構造自体は必ずあるが、supportedFeaturesはない可能性がある」という想定で書いてみました。
「その構造が崩れている状態は内部DBがすでにおかしいのでリカバリー不要」として
コードを削減する方向で記述してみましたが、ケアしておいたほうがよかったでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
たしかにengineManifests[selectedId]
は必ず存在しそうですね!
プルリクの形そのままでも特に問題なさそうに思いました!
(どちらかというと過去のコードの意図がわからない=大事な可能性もあるので、まあとりあえずundefinedの可能性があると想定したコードにしたほうが良いかな・・・。みたいな気持ちでした!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selectedId が engineIcons (≒engineManifests)から生成されるので
これは違いますね。(225行目のはアイコンを取れるかどうかの確認、アイコンのフォールバック用です)
エンジン管理ダイアログはエンジンが起動してなくても開ける必要があります。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビューありがとうございます。理解を間違えました。
selectedIdは変数で
・項目を選択したとき(74行目)に selectEngine() (559行目) でセットされる
・初期値は ”” (421行目)
・確認の通信はエンジンに対しておこなっているので、通信が返ってこない可能性はある
この挙動から行くと、状態が変化したときに
一時的にでも変数が一致しない状況は起きうるとおもったので、
レビュー頂いたコードを追加してPRします。
PRありがとうございます!! コードはほぼ問題ないのかなと思います! |
・MinimumEngineManifestの更新
・engineManifests[selectedId]自体が undefined であるケースに対応
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
良い感じの着地なのかなと思いました!!
プルリクありがとうございます!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
修正ありがとうございました!!
提案から修正・PR・その後のやり取りまですごくやりやすかったです!!
もしよかったらぜひまたプルリクエストお待ちしています!!
(初心者歓迎ラベルは結構いろいろ探しやすいかもです!)
問題ないと思うのでマージします! |
* 未対応エンジン追加時にリストが消える件(#1168) ・追加されたエンジンが未対応である場合には追加を阻止 ・追加されてしまっている場合には、エラーで処理中断しないように * lintチェックエラー部分の修正 * コードレビューの反映 (ref #1179) ・MinimumEngineManifestの更新 * コードレビュー分の反映② ref #1179 ・engineManifests[selectedId]自体が undefined であるケースに対応 * サードパーティがエンジンへのアクセス情報を得るための設定書き出し機能(ref #1738) * ファイルは runtime-info.json に書き出し * エンジン全起動もしくは個別起動/終了のタイミングで更新 * * 関数名の変更 : writeEngineInfoFor3rdParty * 排他ロックの追加 * 処理の非同期化 * * コンストラクタ引数でファイルパスを渡すように * 関数をシンプルに * ログメッセージ修正 * コメント位置修正 * * エクスポートファイパスを渡す所を引数にした * 変数、関数名修正 * いくつかの構造をクラス化 * 議論 #1738 に基づき、最小項目の書き出しに変更 * * ファイル書き出しクラスに機能を集約 * 変数名、コメントの修正 * RuntimeInfoManager.tsをブラッシュアップ * EngineManagerとRuntimeInfoManagerを疎結合に * データ構造調整、テスト追加 * Apply suggestions from code review --------- Co-authored-by: Hiroshiba <[email protected]>
* 未対応エンジン追加時にリストが消える件(#1168) ・追加されたエンジンが未対応である場合には追加を阻止 ・追加されてしまっている場合には、エラーで処理中断しないように * lintチェックエラー部分の修正 * コードレビューの反映 (ref #1179) ・MinimumEngineManifestの更新 * コードレビュー分の反映② ref #1179 ・engineManifests[selectedId]自体が undefined であるケースに対応 * ref #1738 の会話にあった「情報ファイルに関するドキュメント」(新規執筆) * markdown lint でエラーが出てた件の修正 * Update docs/サードパーティ開発者の方へ.md Co-authored-by: Hiroshiba <[email protected]> * フォーマット表記提案サジェストの適用 Co-authored-by: Nanashi. <[email protected]> * * 表の表記をJSONP内コメント追記に * VOICEVOXの仕組みを追記 * 環境変数の修正 Co-authored-by: Hiroshiba <[email protected]> * コメントいただいた部分を中心に追記 * Update docs/サードパーティ開発者の方へ.md --------- Co-authored-by: Hiroshiba <[email protected]> Co-authored-by: Nanashi. <[email protected]>
* 未対応エンジン追加時にリストが消える件(#1168) ・追加されたエンジンが未対応である場合には追加を阻止 ・追加されてしまっている場合には、エラーで処理中断しないように * lintチェックエラー部分の修正 * コードレビューの反映 (ref #1179) ・MinimumEngineManifestの更新 * コードレビュー分の反映② ref #1179 ・engineManifests[selectedId]自体が undefined であるケースに対応 * 貢献者ガイドラインを明文化 (ref #1190) * レビュー結果の反映① * 着手周りの手順追記 * CONTRIBUTING.md として配置変更 * markdownlint のエラーを修正 * * ローカル実行時の markdownlint 検索範囲を修正 * Issueを閉じるタイミングを追記 * * ドラフトプルリクエストについての追記 * フォーマットの修正 * * プルリクエストの表記を英語に。 * WIPに付いてのトーンを弱めに。 * リンク切れの修正 * 「その他」の 追記 * * レビュー内容の反映 * * e2e部分の追記 * インデント修正 * 提案いただいた分のコミットと追記 * ・査読分の反映 ・README.mdに誘導リンクを追加 * Apply suggestions from code review * フォーマットを整える * 崩れてしまった部分を戻す * こう? * なぜか * に戻っていた * pythonはコメントアウトが // ではなかった --------- Co-authored-by: Hiroshiba <[email protected]>
内容
supported_featuresが見当たらないときの処理を追加
・追加されたエンジンが未対応である場合には追加を阻止
・追加されてしまっている場合には、エラーで処理中断しないように
関連 Issue
ref #1168
スクリーンショット・動画など
その他