bug(copi): next_round and toggle_continue_vote can be triggered on unstarted or finished games
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 158
- Forks
- 110
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 115
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OWASP/cornucopia
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
OWASP/cornucopia#3778 ·
Los mantenedores suelen responder en 1 día
-
Upgrade @vitest/mocker from 4.1.10 to 5.0Quizá libre de nuevo @Mahaboobunnisa123 la tomó hace 43 días y no hay ningún pull request abierto. Abiertohelp wanted javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
OWASP/cornucopia#3538 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
OWASP/cornucopia#3784 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
OWASP/cornucopia#3783 ·
Los mantenedores suelen responder en 1 día
-
Add the Hindi translation for the Companion EditionPosiblemente ocupada @V-2007-P la tomó hace 2 días. Abierto
OWASP/cornucopia#3770 · 6 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de OWASP/cornucopia
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
AI bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
AUTO-MAS-Project/AUTO-MAS#1960 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
btclib-org/btclib-wallet#872 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme loadPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
saltstack/salt#70789 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
btclib-org/btclib#3093 ·
Los mantenedores suelen responder en 1 día