From 367d7eeabc61a18caf4505367de53689c08595fa Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 27 Dec 2025 15:16:58 +0100 Subject: [PATCH] fix(proxy): defer UI refresh until Traefik version check completes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #7732 - The proxy status change listener was dispatching ProxyStatusChangedUI before the Traefik version check job had a chance to run. This caused users to see stale version information when they refreshed the page immediately after restarting the proxy. The fix defers the UI refresh when a Traefik version check is being dispatched. The version check job already dispatches its own ProxyStatusChangedUI event when complete, ensuring the UI refreshes with updated version data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- app/Listeners/ProxyStatusChangedNotification.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Listeners/ProxyStatusChangedNotification.php b/app/Listeners/ProxyStatusChangedNotification.php index 1d99e7057..30ecb2d8d 100644 --- a/app/Listeners/ProxyStatusChangedNotification.php +++ b/app/Listeners/ProxyStatusChangedNotification.php @@ -29,7 +29,8 @@ public function handle(ProxyStatusChanged $event) $server->proxy->set('status', $status); $server->save(); - ProxyStatusChangedUI::dispatch($server->team_id); + $versionCheckDispatched = false; + if ($status === 'running') { $server->setupDefaultRedirect(); $server->setupDynamicProxyConfiguration(); @@ -40,7 +41,9 @@ public function handle(ProxyStatusChanged $event) if ($server->proxyType() === ProxyTypes::TRAEFIK->value) { $traefikVersions = get_traefik_versions(); if ($traefikVersions !== null) { + // Version check job will dispatch ProxyStatusChangedUI when complete CheckTraefikVersionForServerJob::dispatch($server, $traefikVersions); + $versionCheckDispatched = true; } else { Log::warning('Traefik version check skipped after proxy status change: versions.json data unavailable', [ 'server_id' => $server->id, @@ -49,6 +52,13 @@ public function handle(ProxyStatusChanged $event) } } } + + // Only dispatch UI refresh if version check wasn't dispatched + // (version check job handles its own UI refresh with updated version data) + if (! $versionCheckDispatched) { + ProxyStatusChangedUI::dispatch($server->team_id); + } + if ($status === 'created') { instant_remote_process([ 'docker rm -f coolify-proxy',