From ff8b019296025bdf0e8a08c1989b270193edddc4 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 31 Aug 2026 21:12:28 +0200 Subject: [PATCH] fix(application): defer Docker Compose loading and preserve domains Load the compose file only after the user confirms its location, initialize the default compose path when switching build packs, and retain existing application domains. --- app/Livewire/Project/Application/General.php | 22 ++---------- .../project/application/general.blade.php | 3 +- ...pplicationGeneralBuildpackSelectorTest.php | 35 +++++++++++++++++++ .../Feature/ApplicationGeneralLayoutTest.php | 8 +++++ 4 files changed, 47 insertions(+), 21 deletions(-) diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php index c5015dccc0..0c424631f7 100644 --- a/app/Livewire/Project/Application/General.php +++ b/app/Livewire/Project/Application/General.php @@ -321,17 +321,6 @@ class General extends Component } } $this->initialDockerComposeLocation = $this->application->docker_compose_location; - if ($this->application->build_pack === 'dockercompose' && ! $this->application->docker_compose_raw) { - // Only load compose file if user has update permission - try { - $this->authorize('update', $this->application); - $this->initLoadingCompose = true; - $this->dispatch('info', 'Loading docker compose file.'); - } catch (AuthorizationException $e) { - // User doesn't have update permission, skip loading compose file - } - } - if (str($this->application->status)->startsWith('running') && is_null($this->application->config_hash)) { $this->dispatch('configurationChanged'); } @@ -608,14 +597,9 @@ class General extends Component $this->resetDefaultLabels(false); } if ($this->buildPack === 'dockercompose') { - // Only update if user has permission - try { - $this->authorize('update', $this->application); - $this->fqdn = null; - $this->application->fqdn = null; - $this->application->settings->save(); - } catch (AuthorizationException $e) { - // User doesn't have update permission, just continue without saving + if (blank($this->dockerComposeLocation)) { + $this->dockerComposeLocation = '/docker-compose.yaml'; + $this->application->docker_compose_location = $this->dockerComposeLocation; } } if ($this->buildPack === 'static') { diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index 7384067f98..d301b55b5a 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -119,8 +119,7 @@ @else
@if ($buildPack === 'dockercompose') -
+
not->toContain('x-init="$wire.dispatch(\'loadCompose\', true)"'); +}); + test('docker compose heading separates its title and action', function () { $view = file_get_contents(resource_path('views/livewire/project/application/general.blade.php'));