From 2c8e568255a9eb4a5b1a3c689531304b3dacc739 Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 13 Aug 2026 00:14:00 +0200 Subject: [PATCH] Fix sessions never persisting as PLAYING, and dangerous-mode logrotate configs checkAllPlayersReady() set the session to PLAYING and cleared/updated its timer in memory but never flushed, relying on callers to do so. The toggleReady() caller flushed right after, but GameController::index()'s lazy catch-up call did not - so if the "everyone ready" transition was only detected on a page load (e.g. players didn't click ready within the same 60s window), the terminal would render for that one request from the in-memory state, letting the game be played entirely through the unguarded message API, while the database silently kept the session on 'ready' with timer 0 forever. This made sessions invisible to the mainframe hint cron and the admin "running sessions" count. Moved the flush inside checkAllPlayersReady() itself so both callers persist reliably. Also chmod the logrotate configs after COPY in the Dockerfile, since their on-disk mode ended up group-writable (0664) depending on the build host's umask, which made logrotate refuse to use them. Co-Authored-By: Claude Sonnet 5 --- docker/php/Dockerfile | 1 + src/Game/Service/GameDashboardService.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index 7e96740..d6af590 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -50,6 +50,7 @@ RUN chmod 0600 /etc/crontabs/root # Log rotation for the cron hint-check and PHP error logs: 25MB per file, kept for 3 months. COPY docker/php/logrotate/cron-hints.conf /etc/logrotate.d/cron-hints COPY docker/php/logrotate/php-logs.conf /etc/logrotate.d/php-logs +RUN chmod 0644 /etc/logrotate.d/cron-hints /etc/logrotate.d/php-logs # Adjust www-data UID/GID to match host user (default 1000) ARG USER_ID=1000 diff --git a/src/Game/Service/GameDashboardService.php b/src/Game/Service/GameDashboardService.php index 52f7416..9b30131 100644 --- a/src/Game/Service/GameDashboardService.php +++ b/src/Game/Service/GameDashboardService.php @@ -557,6 +557,8 @@ final class GameDashboardService } } + $this->entityManager->flush(); + try { $topic = '/game/hub/' . $session->getId(); $this->hub->publish(new Update($topic, json_encode(['type' => 'all_ready'])));