fix: use rounds_played directly in handle_info for finished games
Summary
Fixes #2548.
handle_info/2 in GameLive.Show always set requested_round = updated_game.rounds_played + 1 when a game:updated broadcast was received, even for games that are already finished. This caused the finished-game summary page to show a non-existent round.
handle_params/3 already handled this correctly with a finished_at check. This PR applies the same logic to handle_info/2.
Changes
copi.owasp.org/lib/copi_web/live/game_live/show.ex: mirrorhandle_paramsfinished-game check insidehandle_infocopi.owasp.org/test/copi_web/live/game_live/show_test.exs: add test verifyingrequested_roundstays atrounds_played(not+1) after a broadcast for a finished game
@sydseter is this good to go ???
Hello @immortal71, This is a solid PR that addresses a specific UI bug where finished games would incorrectly show a non-existent round number when receiving game update broadcasts. The fix is straightforward and follows the existing pattern already implemented in handle_params/3, making it a clean and consistent solution. You also took the opportunity to significantly improve test coverage across the codebase, which is always valuable. However, the PR description is misleading as it only mentions two files but actually includes additional bug fixes in convert_capec.py and extensive test additions across multiple modules. The description should be updated to accurately reflect all the changes being introduced.
@sydseter just here for follow up,..... is this good to go
@immortal71 Looks good, but there are some merge conflicts here as well.
@sydseter is this good to go ?
Please remove all the # coveralls-ignore comments.
Please do not ignore coveralls.
okay
@sydseter is this good to go ?
wait i think there is one conflict
@sydseter now is it okay ?
@immortal71 the code has conflicts