Skip to content
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

fix(backend): リバーシの設定変更が反映されないのを修正 #14404

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

kakkokari-gtyih
Copy link
Contributor

What

  • リバーシの対局設定が変更できないのを修正
  • updateする際のバリデーションをちゃんと書いた(正しいか要確認

Why

Fix #14397

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added packages/backend Server side specific issue/PR packages/misskey-js labels Aug 13, 2024
Copy link
Contributor

github-actions bot commented Aug 13, 2024

このPRによるapi.jsonの差分

差分はこちら

Get diff files from Workflow Page

Comment on lines +407 to +424
public isValidReversiUpdateValue<K extends typeof reversiUpdateKeys[number]>(key: K, value: unknown): value is MiReversiGame[K] {
switch (key) {
case 'map':
return Array.isArray(value) && value.every(row => typeof row === 'string');
case 'bw':
return typeof value === 'string' && ['random', '1', '2'].includes(value);
case 'isLlotheo':
return typeof value === 'boolean';
case 'canPutEverywhere':
return typeof value === 'boolean';
case 'loopedBoard':
return typeof value === 'boolean';
case 'timeLimitForEachTurn':
return typeof value === 'number' && value >= 0;
default:
return false;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちゃんとした値の定義が存在しなかったので、必要な値をはじいていないかをしゅいろさんに確認してもらう必要あり

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よく覚えていない

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 24.24242% with 25 lines in your changes missing coverage. Please review.

Project coverage is 41.74%. Comparing base (41936c1) to head (7e7e999).
Report is 5 commits behind head on develop.

Files Patch % Lines
packages/backend/src/core/ReversiService.ts 25.00% 21 Missing ⚠️
...end/src/server/api/stream/channels/reversi-game.ts 20.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14404      +/-   ##
===========================================
+ Coverage    39.91%   41.74%   +1.83%     
===========================================
  Files         1545     1549       +4     
  Lines       190505   196580    +6075     
  Branches      2654     3589     +935     
===========================================
+ Hits         76046    82070    +6024     
- Misses      113898   113949      +51     
  Partials       561      561              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kakkokari-gtyih kakkokari-gtyih added this to the v2024.8.0 milestone Aug 13, 2024
@kakkokari-gtyih
Copy link
Contributor Author

@bindThisって基本入れたほうがいいのかしら

@anatawa12
Copy link
Member

@bindThis自身はinstance.someMethodって引数で渡すことが一切ないならなくても困らないはずだけど、今後起きることを考えるとつけとくと良いと認識してます。

javascriptではconst a = instance.someMethodってやったあとにa()って呼ぶとaの中でthisinstanceと違う値になって壊れることがよくあります。これの対策と思われます

@kakkokari-gtyih
Copy link
Contributor Author

いれた

@syuilo syuilo merged commit a8810af into misskey-dev:develop Aug 16, 2024
28 checks passed
@syuilo
Copy link
Member

syuilo commented Aug 16, 2024

🙏🏻

@kakkokari-gtyih kakkokari-gtyih deleted the fix-14397 branch August 16, 2024 12:03
LemonDouble pushed a commit to LemonDouble/misskey that referenced this pull request Aug 19, 2024
* fix(backend): リバーシの設定変更が反映されないのを修正

* Update Changelog

* add bindthis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR packages/misskey-js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

リバーシ:対局の設定が反映されない
4 participants