bug(copi): next_round and toggle_continue_vote can be triggered on unstarted or finished games
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Describe the bug
In copi.owasp.org/lib/copi_web/live/player_live/show.ex, while toggle_vote verifies that a game is active before accepting votes (via PR #3662), next_round and toggle_continue_vote do not check game.started_at or game.finished_at.
As a result:
- On unstarted games: A player in the lobby can trigger
next_round. Because cards haven't been dealt yet,last_round?evaluates totrue, which immediately setsfinished_atand ends the game session before the host can start it. - On finished games: Players can continue calling
next_roundandtoggle_continue_vote, modifying database state and advancingrounds_playedon a completed game.
Code Reference
In copi.owasp.org/lib/copi_web/live/player_live/show.ex:
handle_event("next_round", ...)(lines 122–152)handle_event("toggle_continue_vote", ...)(lines 155–192)
Neither handler checks is_nil(game.started_at) or not is_nil(game.finished_at), unlike handle_toggle_vote in the same file.
Expected Behavior
Both events should require the game to be active (not is_nil(game.started_at) and is_nil(game.finished_at)), matching Copi.Cornucopia.Game.active?/1 and rejecting calls on unstarted or finished games with a flash notice.
Proposed Solution
Add the existing lifecycle guard checks to both handlers in player_live/show.ex and add LiveView regression tests in show_test.exs.
- 主要言語
- Python
- スター
- 158
- フォーク
- 110
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 115
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OWASP/cornucopia のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
OWASP/cornucopia#3778 ·
メンテナーはふだん 1 日以内に返信
-
Upgrade @vitest/mocker from 4.1.10 to 5.0再び着手できるかも @Mahaboobunnisa123 が 43 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンhelp wanted javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
OWASP/cornucopia#3538 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
OWASP/cornucopia#3784 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
OWASP/cornucopia#3783 ·
メンテナーはふだん 1 日以内に返信
-
Add the Hindi translation for the Companion Edition対応中かも @V-2007-P が 2 日前に担当しました。 オープン
OWASP/cornucopia#3770 · コメント 6 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
OWASP/cornucopia の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
AI bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AUTO-MAS-Project/AUTO-MAS#1960 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
btclib-org/btclib-wallet#872 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme load対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
saltstack/salt#70789 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
btclib-org/btclib#3093 ·
メンテナーはふだん 1 日以内に返信