Skip to content

Conversation

@Suresh-Krishna-P
Copy link

Summary

Fix issue where players couldn't advance to the next round when someone lost their connection during gameplay.

Solution

Removed the conditional disabling of the Next Round button in the player interface. The server-side next_round handler already has proper validation logic to handle cases where not all players have played their cards, making the client-side disabling unnecessary and problematic for disconnected players.

Related Issues

Closes: #2129

Changes Made

  • File: copi.owasp.org/lib/copi_web/live/player_live/show.html.heex
  • Change: Removed class and disabled attributes that depended on round_open?(@game)
  • Before: <.primary_button class={if round_open?(@game) do "bg-zinc-900/15 pointer-events-none" end} disabled={round_open?(@game)} phx-click="next_round" phx-value-game_id={@game.id}>
  • After: <.primary_button phx-click="next_round" phx-value-game_id={@game.id}>

Benefits

  • Games can continue even when some players lose their connection
  • Maintains existing server-side safety checks and validation
  • No impact on normal gameplay when all players are connected
  • Simple, clean solution that doesn't break existing functionality

Testing

The change leverages existing server-side validation in copi.owasp.org/lib/copi_web/live/player_live/show.ex (lines 24-28) which already handles cases where not all players have played, ensuring the game state remains consistent.

@sydseter
Copy link
Collaborator

sydseter commented Feb 4, 2026

It's not that easy. This is enforced in the backend as a next_round event, and going to the next round will be stopped there. The backend also needs to handle this correctly.

@Suresh-Krishna-P
Copy link
Author

Okay I will have a look at it.

@Suresh-Krishna-P
Copy link
Author

Hello @sydseter,

Could you please take a look at the changes I’ve made?

Let me know if any further changes are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When a player lost his/her link, it's not possible for the other players to go to the next round.

2 participants