An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(livewire): prevent stale keys and refresh races
Andras Bacsaib357522f94f1
diff --git a/AGENTS.md b/AGENTS.mdindex 4d78dfd938..34b43e0876 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -191,6 +191,23 @@ Coolify seeds **instance-owned** rows at primary key `0`. That value is a sentin- Exception handler: `app/Exceptions/Handler.php`- Service providers in `app/Providers/`+## Livewire conventions++### Dynamic lists and snapshot errors++When an add, delete, or conversion leaves controls unresponsive and the browser reports `Snapshot missing on Livewire component`, inspect both component keys and refresh events. Stable keys alone may not fix it.++- Give every Livewire component rendered in a loop a stable key based on the record ID, UUID, filename, or another immutable identity. Never include a collection count, `$loop->index`, or a reindexed array position in the key.+- Pass the same stable identity to edit/delete actions. A keyed row can survive reordering while a `wire:ignore` or teleported Alpine modal keeps its original `submitAction`; an action such as `removeItem($index)` then targets a stale position after the first deletion. Resolve the current row server-side from an ID, UUID, or stable row hash instead.+- Do not broadcast one refresh event to both a parent list component and children that the parent may insert, remove, or hide during the same operation. This can queue a child update after its snapshot has been removed from the DOM.+- Split refresh responsibilities into targeted events. Refresh the parent for counts and tab visibility, and refresh an existing child list with a separate event. Use `$this->dispatch('event')->to(Component::class)` instead of a page-wide event when possible.+- Before targeting a child list, confirm that it existed before the mutation, still exists afterward, and is on the active tab. A newly inserted child loads current data during `mount()` and does not need an immediate refresh. A removed or hidden child must not receive one.+- A child that deletes itself should finish its own update, then target only the parent to refresh counts. The parent should not send a refresh back to that child when the list became empty.+- Apply the same pattern to file, directory, conversion, and external reload paths such as Compose edits. One remaining broad event can reproduce the race.+- Add regression tests that assert the scoped event names, assert the old broad event is not dispatched, and verify that keys do not depend on counts or positions. Manually repeat add/delete operations while watching the browser console.++The persistent-storage implementation is the reference pattern: `Project\Service\Storage` handles `storageCountsChanged`, while `Project\Shared\Storages\All` handles `refreshVolumeList`.+## Key Conventions- Use `php artisan make:*` commands with `--no-interaction` to create filesdiff --git a/app/Livewire/Destination/Show.php b/app/Livewire/Destination/Show.phpindex 03fa2b5109..63ceebef4e 100644--- a/app/Livewire/Destination/Show.php+++ b/app/Livewire/Destination/Show.php@@ -85,7 +85,7 @@ class Show extends Component}$this->destination->delete();- return redirect()->route('destination.index');+ return redirectRoute($this, 'destination.index');} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Project/Application/Domains.php b/app/Livewire/Project/Application/Domains.phpindex 2f9370871c..4168a208cc 100644--- a/app/Livewire/Project/Application/Domains.php+++ b/app/Livewire/Project/Application/Domains.php@@ -1322,6 +1322,28 @@ class Domains extends Component}}+ public function removeDomainByKey(string $domainKey): void+ {+ $index = collect($this->domainRows)->search(+ fn (array $row): bool => ! ($row['is_suggested'] ?? false)+ && hash_equals($domainKey, $this->domainRowKey($row))+ );++ if ($index === false) {+ return;+ }++ $this->removeDomain((int) $index);+ }++ /**+ * @param array{url: string, service?: ?string} $row+ */+ private function domainRowKey(array $row): string+ {+ return hash('sha256', $row['url'].'|'.($row['service'] ?? ''));+ }+public function generateDomain(?string $serviceName = null): void{try {diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.phpindex 34283cd47f..c5015dccc0 100644--- a/app/Livewire/Project/Application/General.php+++ b/app/Livewire/Project/Application/General.php@@ -4,6 +4,7 @@ namespace App\Livewire\Project\Application;use App\Actions\Application\GenerateConfig;use App\Jobs\ApplicationDeploymentJob;+use App\Livewire\Project\Service\Storage;use App\Models\Application;use App\Rules\ValidGitBranch;use App\Support\ValidationPatterns;@@ -530,7 +531,7 @@ class General extends Component$showToast && $this->dispatch('success', 'Docker compose file loaded.');$this->dispatch('compose_loaded');- $this->dispatch('refreshStorages');+ $this->dispatch('storageCountsChanged')->to(Storage::class);$this->dispatch('refreshEnvs');} catch (\Throwable $e) {// Refresh model to get restored values from Application::loadComposeFilediff --git a/app/Livewire/Project/Database/InitScript.php b/app/Livewire/Project/Database/InitScript.phpindex 7074c235d5..eba1c4d8f7 100644--- a/app/Livewire/Project/Database/InitScript.php+++ b/app/Livewire/Project/Database/InitScript.php@@ -22,6 +22,9 @@ class InitScript extends Component#[Locked]public int $index;+ #[Locked]+ public string $originalFilename;+#[Validate(['nullable', 'string'])]public ?string $filename = null;@@ -33,6 +36,7 @@ class InitScript extends Componenttry {$this->index = data_get($this->script, 'index');$this->filename = data_get($this->script, 'filename');+ $this->originalFilename = (string) data_get($this->script, 'filename');$this->content = data_get($this->script, 'content');} catch (Exception $e) {return handleError($e, $this);@@ -47,7 +51,7 @@ class InitScript extends Component$this->script['index'] = $this->index;$this->script['content'] = $this->content;$this->script['filename'] = $this->filename;- $this->dispatch('save_init_script', $this->script);+ $this->dispatch('save_init_script', $this->script, $this->originalFilename);} catch (Exception $e) {return handleError($e, $this);}diff --git a/app/Livewire/Project/Database/Postgresql/General.php b/app/Livewire/Project/Database/Postgresql/General.phpindex 051fb515d9..83d6e97dfa 100644--- a/app/Livewire/Project/Database/Postgresql/General.php+++ b/app/Livewire/Project/Database/Postgresql/General.php@@ -247,16 +247,16 @@ class General extends Component}}- public function save_init_script($script)+ public function save_init_script($script, string $originalFilename){$this->authorize('update', $this->database);$initScripts = collect($this->initScripts ?? []);$existingScript = $initScripts->firstWhere('filename', $script['filename']);- $oldScript = $initScripts->firstWhere('index', $script['index']);+ $oldScript = $initScripts->firstWhere('filename', $originalFilename);- if ($existingScript && $existingScript['index'] !== $script['index']) {+ if ($existingScript && $script['filename'] !== $originalFilename) {$this->dispatch('error', 'A script with this filename already exists.');return;@@ -285,11 +285,10 @@ class General extends Component}}- $index = $initScripts->search(function ($item) use ($script) {- return $item['index'] === $script['index'];- });+ $index = $initScripts->search(fn ($item) => $item['filename'] === $originalFilename);if ($index !== false) {+ $script['index'] = $oldScript['index'];$initScripts[$index] = $script;} else {$initScripts->push($script);diff --git a/app/Livewire/Project/Service/Domains.php b/app/Livewire/Project/Service/Domains.phpindex d932e76494..7708e55352 100644--- a/app/Livewire/Project/Service/Domains.php+++ b/app/Livewire/Project/Service/Domains.php@@ -1243,6 +1243,28 @@ class Domains extends Component}}+ public function removeDomainByKey(string $domainKey): void+ {+ $index = collect($this->domainRows)->search(+ fn (array $row): bool => ! ($row['is_suggested'] ?? false)+ && hash_equals($domainKey, $this->domainRowKey($row))+ );++ if ($index === false) {+ return;+ }++ $this->removeDomain((int) $index);+ }++ /**+ * @param array{url: string, service_application_id: int|string} $row+ */+ private function domainRowKey(array $row): string+ {+ return hash('sha256', $row['url'].'|'.$row['service_application_id']);+ }+public function addSuggestedDomain(int $index): void{try {diff --git a/app/Livewire/Project/Service/EditCompose.php b/app/Livewire/Project/Service/EditCompose.phpindex 46a8ecdc89..2feafe41a2 100644--- a/app/Livewire/Project/Service/EditCompose.php+++ b/app/Livewire/Project/Service/EditCompose.php@@ -78,7 +78,7 @@ class EditCompose extends Componenttry {$this->authorize('update', $this->service);$this->dispatch('saveCompose', $this->dockerComposeRaw);- $this->dispatch('refreshStorages');+ $this->dispatch('storageCountsChanged')->to(Storage::class);} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Project/Service/FileStorage.php b/app/Livewire/Project/Service/FileStorage.phpindex 84a0daec8a..4520876d16 100644--- a/app/Livewire/Project/Service/FileStorage.php+++ b/app/Livewire/Project/Service/FileStorage.php@@ -160,7 +160,7 @@ class FileStorage extends Component} catch (\Throwable $e) {return handleError($e, $this);} finally {- $this->dispatch('refreshStorages');+ $this->dispatch('storageCountsChanged')->to(Storage::class);}}@@ -179,7 +179,7 @@ class FileStorage extends Component} catch (\Throwable $e) {return handleError($e, $this);} finally {- $this->dispatch('refreshStorages');+ $this->dispatch('storageCountsChanged')->to(Storage::class);}}@@ -207,7 +207,7 @@ class FileStorage extends Component} catch (\Throwable $e) {return handleError($e, $this);} finally {- $this->dispatch('refreshStorages');+ $this->dispatch('storageCountsChanged')->to(Storage::class);}}@@ -242,7 +242,7 @@ class FileStorage extends Component} catch (\Throwable $e) {return handleError($e, $this);} finally {- $this->dispatch('refreshStorages');+ $this->dispatch('storageCountsChanged')->to(Storage::class);}return true;diff --git a/app/Livewire/Project/Service/Storage.php b/app/Livewire/Project/Service/Storage.phpindex ce278522b6..adb19a3135 100644--- a/app/Livewire/Project/Service/Storage.php+++ b/app/Livewire/Project/Service/Storage.php@@ -2,6 +2,7 @@namespace App\Livewire\Project\Service;+use App\Livewire\Project\Shared\Storages\All as StorageList;use App\Models\Application;use App\Models\LocalFileVolume;use App\Models\LocalPersistentVolume;@@ -51,7 +52,7 @@ class Storage extends Componentreturn ["echo-private:team.{$teamId},FileStorageChanged" => 'refreshStoragesFromEvent',- 'refreshStorages',+ 'storageCountsChanged' => 'refreshStorages','addNewVolume',];}@@ -87,11 +88,17 @@ class Storage extends Componentpublic function refreshStorages(){+ $hadVolumes = $this->cachedVolumeCount > 0;+// Avoid loading full volume models onto this parent (child All owns that snapshot).$this->resource->unsetRelation('persistentStorages');$this->loadVolumeCount();$this->loadFileStorageMetaCounts();$this->loadFileStorageForActiveTab();++ if ($this->activeTab === 'volumes' && $hadVolumes && $this->cachedVolumeCount > 0) {+ $this->dispatch('refreshVolumeList')->to(StorageList::class);+ }}public function setActiveTab(string $tab): void@@ -223,7 +230,6 @@ class Storage extends Component$this->dispatch('configurationChanged');$this->dispatch('success', 'Volume added successfully');$this->dispatch('closeStorageModal', 'volume');- $this->dispatch('refreshStorages');} catch (\Throwable $e) {return handleError($e, $this);}@@ -258,7 +264,6 @@ class Storage extends Component$this->dispatch('configurationChanged');$this->dispatch('success', 'File mount added successfully');$this->dispatch('closeStorageModal', 'file');- $this->dispatch('refreshStorages');} catch (\Throwable $e) {return handleError($e, $this);}@@ -293,7 +298,6 @@ class Storage extends Component$this->dispatch('configurationChanged');$this->dispatch('success', 'Host file mount added successfully');$this->dispatch('closeStorageModal', 'host-file');- $this->dispatch('refreshStorages');} catch (\Throwable $e) {return handleError($e, $this);}@@ -332,7 +336,6 @@ class Storage extends Component$this->dispatch('configurationChanged');$this->dispatch('success', 'Directory mount added successfully');$this->dispatch('closeStorageModal', 'directory');- $this->dispatch('refreshStorages');} catch (\Throwable $e) {return handleError($e, $this);}diff --git a/app/Livewire/Project/Shared/Storages/All.php b/app/Livewire/Project/Shared/Storages/All.phpindex 583c2788a4..fcd7752a0c 100644--- a/app/Livewire/Project/Shared/Storages/All.php+++ b/app/Livewire/Project/Shared/Storages/All.php@@ -2,6 +2,7 @@namespace App\Livewire\Project\Shared\Storages;+use App\Livewire\Project\Service\Storage as StorageComponent;use App\Models\Application;use App\Models\LocalFileVolume;use App\Models\LocalPersistentVolume;@@ -44,7 +45,7 @@ class All extends Componentpublic bool $deleteDockerVolume = false;- protected $listeners = ['refreshStorages' => 'refreshList', 'refreshVolumeBackups' => 'refreshList'];+ protected $listeners = ['refreshVolumeList' => 'refreshList', 'refreshVolumeBackups' => 'refreshList'];public function mount(): void{@@ -163,7 +164,7 @@ class All extends Component$storage->delete();$this->refreshList();- $this->dispatch('refreshStorages');+ $this->dispatch('storageCountsChanged')->to(StorageComponent::class);$this->dispatch('configurationChanged');return true;diff --git a/app/Livewire/Project/Shared/Storages/Show.php b/app/Livewire/Project/Shared/Storages/Show.phpindex 7e1e2dec1d..c70ebc57fd 100644--- a/app/Livewire/Project/Shared/Storages/Show.php+++ b/app/Livewire/Project/Shared/Storages/Show.php@@ -2,6 +2,7 @@namespace App\Livewire\Project\Shared\Storages;+use App\Livewire\Project\Service\Storage as StorageComponent;use App\Models\Application;use App\Models\LocalPersistentVolume;use App\Models\ScheduledVolumeBackup;@@ -192,7 +193,7 @@ class Show extends Component}$this->storage->delete();- $this->dispatch('refreshStorages');+ $this->dispatch('storageCountsChanged')->to(StorageComponent::class);$this->dispatch('configurationChanged');return true;diff --git a/config/constants.php b/config/constants.phpindex e6e1a50f82..cb41d2f6f7 100644--- a/config/constants.php+++ b/config/constants.php@@ -2,7 +2,7 @@return ['coolify' => [- 'version' => env('COOLIFY_VERSION') ?: '4.3.12',+ 'version' => env('COOLIFY_VERSION') ?: '4.3.13','helper_version' => '1.0.16','realtime_version' => '1.0.17','railpack_version' => '0.23.0',diff --git a/other/nightly/versions.json b/other/nightly/versions.jsonindex a9c5daea6a..a87ca37c50 100644--- a/other/nightly/versions.json+++ b/other/nightly/versions.json@@ -1,7 +1,7 @@{"coolify": {"v4": {- "version": "4.3.12"+ "version": "4.3.13"},"nightly": {"version": "4.4-rc.1"diff --git a/resources/views/components/application/configuration-sidebar.blade.php b/resources/views/components/application/configuration-sidebar.blade.phpindex 078f3cafa4..774bc49f0a 100644--- a/resources/views/components/application/configuration-sidebar.blade.php+++ b/resources/views/components/application/configuration-sidebar.blade.php@@ -261,7 +261,8 @@<span class="menu-item-label">{{ $menuItem['label'] }}</span>@if ($menuItem['badge'] ?? false)<span class="shrink-0">- <livewire:project.application.server-status-badge :application="$application" />+ <livewire:project.application.server-status-badge :application="$application"+ :key="'application-server-status-'.$application->uuid" /></span>@endif</a>diff --git a/resources/views/livewire/project/application/partials/domain-row.blade.php b/resources/views/livewire/project/application/partials/domain-row.blade.phpindex 6c20d0a46d..b41d3a431f 100644--- a/resources/views/livewire/project/application/partials/domain-row.blade.php+++ b/resources/views/livewire/project/application/partials/domain-row.blade.php@@ -37,9 +37,10 @@->keys()->first();$showDirection = ($showDirectionControl ?? true) && ! $isSuggested && $firstPairRowIndex === $index;+ $domainKey = hash('sha256', $row['url'].'|'.($row['service'] ?? ''));@endphp-<div wire:key="domain-row-{{ $index }}-{{ md5(($isSuggested ? 's:' : '') . $row['url'] . '|' . ($row['service'] ?? '')) }}"+<div wire:key="domain-row-{{ md5(($isSuggested ? 's:' : '') . $row['url'] . '|' . ($row['service'] ?? '')) }}"class="env-table-item"><div @class(['data-table-row',@@ -185,7 +186,7 @@<x-reicon name="settings" class="size-3.5" /></button><x-modal-confirmation class="!w-auto shrink-0" title="Remove domain?" buttonTitle="Remove"- isErrorButton submitAction="removeDomain({{ $index }})" :actions="[+ isErrorButton submitAction="removeDomainByKey({{ $domainKey }})" :actions="['This domain will be removed from the application.','Redeploy or restart may be required for proxy changes.',]" :confirmWithPassword="false" :confirmWithText="false" step2ButtonText="Remove domain">diff --git a/resources/views/livewire/project/database/postgresql/general.blade.php b/resources/views/livewire/project/database/postgresql/general.blade.phpindex 738c46fea9..130669b01d 100644--- a/resources/views/livewire/project/database/postgresql/general.blade.php+++ b/resources/views/livewire/project/database/postgresql/general.blade.php@@ -138,7 +138,7 @@<div class="divide-y divide-neutral-200 dark:divide-border-subtle">@forelse($initScripts ?? [] as $script)<livewire:project.database.init-script :database="$database" :script="$script"- :wire:key="$script['index']" />+ :wire:key="'init-script-'.md5($script['filename'])" />@empty<x-empty title="No initialization scripts"description="Add a SQL file to run during the first PostgreSQL initialization." />diff --git a/resources/views/livewire/project/service/partials/domain-table.blade.php b/resources/views/livewire/project/service/partials/domain-table.blade.phpindex f856285adb..f6bda32c65 100644--- a/resources/views/livewire/project/service/partials/domain-table.blade.php+++ b/resources/views/livewire/project/service/partials/domain-table.blade.php@@ -61,9 +61,10 @@->reject(fn ($item) => (bool) ($item['is_suggested'] ?? false))->first(fn ($item) => $redirectPairKey($item['url']) === $pairKey)['url'] ?? null;$showDirection = ! $isSuggested && $firstPairRowUrl === $row['url'];+ $domainKey = hash('sha256', $row['url'].'|'.($row['service_application_id'] ?? ''));@endphp- <div wire:key="svc-domain-{{ $row['service_application_id'] ?? 'x' }}-{{ $index }}-{{ md5(($isSuggested ? 's:' : '') . $row['url']) }}"+ <div wire:key="svc-domain-{{ $row['service_application_id'] ?? 'x' }}-{{ md5(($isSuggested ? 's:' : '') . $row['url']) }}"class="env-table-item"><div @class(['data-table-row',@@ -208,7 +209,7 @@</button><x-modal-confirmation class="!w-auto shrink-0" title="Remove domain?"buttonTitle="Remove" isErrorButton- submitAction="removeDomain({{ $index }})" :actions="[+ submitAction="removeDomainByKey({{ $domainKey }})" :actions="['This domain will be removed from the service application.','Redeploy or restart may be required for proxy changes.',]" :confirmWithPassword="false" :confirmWithText="false"diff --git a/resources/views/livewire/project/service/storage.blade.php b/resources/views/livewire/project/service/storage.blade.phpindex 81c19bd3f0..e2749aad06 100644--- a/resources/views/livewire/project/service/storage.blade.php+++ b/resources/views/livewire/project/service/storage.blade.php@@ -382,7 +382,7 @@icon-name="storages" />@elseif ($activeTab === 'volumes')@if ($hasVolumes)- <livewire:project.shared.storages.all wire:key="volumes-{{ $resource->id }}-{{ $this->volumeCount }}"+ <livewire:project.shared.storages.all wire:key="volumes-{{ $resource->id }}":resource="$resource" />@else<x-empty size="sm" title="No volumes configured"@@ -449,7 +449,7 @@@elseif ($activeTab === 'volumes')@if ($hasVolumes)<livewire:project.shared.storages.all- wire:key="svc-volumes-{{ $resource->id }}-{{ $this->volumeCount }}"+ wire:key="svc-volumes-{{ $resource->id }}":resource="$resource" />@else<x-empty size="sm" title="No volumes configured"diff --git a/resources/views/livewire/project/shared/get-logs.blade.php b/resources/views/livewire/project/shared/get-logs.blade.phpindex 57391233d4..dc64666e2f 100644--- a/resources/views/livewire/project/shared/get-logs.blade.php+++ b/resources/views/livewire/project/shared/get-logs.blade.php@@ -513,19 +513,23 @@@if ($outputs)@php$displayLines = collect(explode("\n", $outputs))->filter(fn($line) => trim($line) !== '');+ $lineOccurrences = [];@endphp<div id="logs" class="font-logs max-w-full cursor-default text-[11px] leading-relaxed sm:text-xs"><div x-show="searchQuery.trim() && matchCount === 0"class="py-2 text-gray-500 dark:text-gray-400">No matches found.</div>- @foreach ($displayLines as $index => $line)+ @foreach ($displayLines as $line)@php+ $lineFingerprint = md5($line);+ $lineOccurrence = $lineOccurrences[$lineFingerprint] ?? 0;+ $lineOccurrences[$lineFingerprint] = $lineOccurrence + 1;+// Parse timestamp from log line (ISO 8601 format: 2025-12-04T11:48:39.136764033Z)$timestamp = '';$logContent = $line;if (preg_match('/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d+))?Z?\s(.*)$/', $line, $matches)) {- $microseconds = isset($matches[2]) ? substr($matches[2], 0, 6) : '000000';$logContent = $matches[3];// Convert UTC Docker timestamp to server timezone for display@@ -537,11 +541,9 @@// keep UTC}$timestamp = $carbonTs->format('Y-M-d H:i:s');- // Include microseconds in key for uniqueness- $lineKey = "{$timestamp}.{$microseconds}";}@endphp- <div wire:key="{{ $lineKey ?? 'line-' . $index }}" data-log-line data-log-content="{{ $line }}" class="log-line logs-viewer-line">+ <div wire:key="log-{{ $lineFingerprint }}-{{ $lineOccurrence }}" data-log-line data-log-content="{{ $line }}" class="log-line logs-viewer-line">@if ($timestamp && $showTimeStamps)<span class="logs-viewer-timestamp text-gray-500">{{ $timestamp }}</span>@endifdiff --git a/resources/views/livewire/server/proxy/dynamic-configurations.blade.php b/resources/views/livewire/server/proxy/dynamic-configurations.blade.phpindex 6e2016370d..2ffc8ae779 100644--- a/resources/views/livewire/server/proxy/dynamic-configurations.blade.php+++ b/resources/views/livewire/server/proxy/dynamic-configurations.blade.php@@ -60,7 +60,7 @@<livewire:server.proxy.dynamic-configuration-navbar:server_id="$server->id" :server="$server" :fileName="$fileName":value="$value ?? ''" :newFile="false"- wire:key="{{ $fileName }}-{{ $loop->index }}" />+ wire:key="proxy-navbar-{{ $fileName }}" />@endif</x-slot:actions><x-forms.textarea disabled wire:model="contents.{{ $fileName }}"diff --git a/resources/views/livewire/settings/scheduled-jobs.blade.php b/resources/views/livewire/settings/scheduled-jobs.blade.phpindex 11d0e5fdd2..4cbd4a8cd0 100644--- a/resources/views/livewire/settings/scheduled-jobs.blade.php+++ b/resources/views/livewire/settings/scheduled-jobs.blade.php@@ -216,7 +216,7 @@<span>Skipped</span></div>@foreach ($managerRuns as $run)- <div wire:key="run-{{ $loop->index }}"+ <div wire:key="run-{{ md5(serialize($run)) }}"x-show="{{ $loop->index }} >= (page - 1) * perPage && {{ $loop->index }} < page * perPage"class="data-table-row scheduler-runs-table-grid border-b border-neutral-200 last:border-b-0 dark:border-white/[0.07]"><div class="font-mono text-[11px] text-neutral-500 dark:text-fg-dim">@@ -272,7 +272,7 @@default => ucfirst(str_replace('_', ' ', $skip['reason'])),};@endphp- <div wire:key="skip-{{ $loop->index }}"+ <div wire:key="skip-{{ md5(serialize($skip)) }}"class="data-table-row skipped-jobs-table-grid border-b border-neutral-200 last:border-b-0 dark:border-white/[0.07]"><div class="font-mono text-[11px] text-neutral-500 dark:text-fg-dim">{{ $skip['timestamp'] }}diff --git a/tests/Feature/ApplicationDomainsTest.php b/tests/Feature/ApplicationDomainsTest.phpindex cac3b29a39..95d0593b7d 100644--- a/tests/Feature/ApplicationDomainsTest.php+++ b/tests/Feature/ApplicationDomainsTest.php@@ -402,6 +402,21 @@ it('removes a domain', function () {expect($this->application->fqdn)->toBe('https://www.example.com');});+it('removes consecutive domains by stable row identity after indexes change', function () {+ $this->application->update([+ 'fqdn' => 'https://first.example.com,https://second.example.com,https://third.example.com',+ ]);++ $component = Livewire::test(Domains::class, ['application' => $this->application->fresh()]);++ $component+ ->call('removeDomainByKey', hash('sha256', 'https://first.example.com|'))+ ->call('removeDomainByKey', hash('sha256', 'https://second.example.com|'))+ ->assertDispatched('success');++ expect($this->application->fresh()->fqdn)->toBe('https://third.example.com');+});+it('does not revalidate dns on remaining domains when removing one', function () {$settings = InstanceSettings::get();$settings->is_dns_validation_enabled = true;diff --git a/tests/Feature/FileStorageMountPathTest.php b/tests/Feature/FileStorageMountPathTest.phpindex b43aae4b19..0b9e450a29 100644--- a/tests/Feature/FileStorageMountPathTest.php+++ b/tests/Feature/FileStorageMountPathTest.php@@ -135,13 +135,44 @@ test('livewire volume storage refreshes the storage list and configuration warni->set('mount_path', '/app/data')->call('submitPersistentVolume')->assertDispatched('success')- ->assertDispatched('refreshStorages')+ ->assertNotDispatched('refreshStorages')+ ->assertNotDispatched('refreshVolumeList')->assertDispatched('configurationChanged')->assertSet('activeTab', 'volumes')->assertSet('volumeCount', 1)->assertSee($this->application->uuid.'-data');});+test('adding another volume refreshes only the mounted volume list', function () {+ LocalPersistentVolume::create([+ 'name' => $this->application->uuid.'-first',+ 'mount_path' => '/app/first',+ 'resource_id' => $this->application->id,+ 'resource_type' => $this->application->getMorphClass(),+ ]);++ Livewire::test(Storage::class, ['resource' => $this->application])+ ->set('name', 'second')+ ->set('mount_path', '/app/second')+ ->call('submitPersistentVolume')+ ->assertDispatched('refreshVolumeList')+ ->assertNotDispatched('refreshStorages');+});++test('deleting a volume asks only the parent storage component to refresh its counts', function () {+ $volume = LocalPersistentVolume::create([+ 'name' => $this->application->uuid.'-data',+ 'mount_path' => '/app/data',+ 'resource_id' => $this->application->id,+ 'resource_type' => $this->application->getMorphClass(),+ ]);++ Livewire::test(All::class, ['resource' => $this->application])+ ->call('delete', $volume->id, 'password')+ ->assertDispatched('storageCountsChanged')+ ->assertNotDispatched('refreshStorages');+});+test('volume storage list shows volumes added after it was mounted', function () {$firstVolume = LocalPersistentVolume::create(['name' => $this->application->uuid.'-first',@@ -191,7 +222,9 @@ test('deleting a file mount refreshes the configuration warning', function () {Livewire::test(FileStorage::class, ['fileStorage' => $file])->call('delete', 'password')- ->assertDispatched('configurationChanged');+ ->assertDispatched('configurationChanged')+ ->assertDispatched('storageCountsChanged')+ ->assertNotDispatched('refreshStorages');expect($file->fresh())->toBeNull();});diff --git a/tests/Feature/PersistentStorageVolumesLayoutTest.php b/tests/Feature/PersistentStorageVolumesLayoutTest.phpindex b22d998914..f3938b87ff 100644--- a/tests/Feature/PersistentStorageVolumesLayoutTest.php+++ b/tests/Feature/PersistentStorageVolumesLayoutTest.php@@ -33,6 +33,16 @@ it('keeps storage backup schedule tables horizontally scrollable on mobile', fun->and($css)->toMatch('/\.backup-table-grid\s*\{[^}]*min-width:\s*50rem;/');});+it('keeps nested storage component keys stable when mounts are added or deleted', function () {+ $view = file_get_contents(resource_path('views/livewire/project/service/storage.blade.php'));++ expect($view)+ ->toContain('wire:key="volumes-{{ $resource->id }}"')+ ->toContain('wire:key="svc-volumes-{{ $resource->id }}"')+ ->not->toContain('wire:key="volumes-{{ $resource->id }}-{{ $this->volumeCount }}"')+ ->not->toContain('wire:key="svc-volumes-{{ $resource->id }}-{{ $this->volumeCount }}"');+});+use App\Livewire\Project\Service\VolumeBackup\Create as CreateServiceVolumeBackup;use App\Livewire\Project\Shared\Storages\All;use App\Models\Application;diff --git a/tests/Feature/ServiceDomainsTest.php b/tests/Feature/ServiceDomainsTest.phpindex 76ca4f2a8a..d18a9a5e5d 100644--- a/tests/Feature/ServiceDomainsTest.php+++ b/tests/Feature/ServiceDomainsTest.php@@ -127,6 +127,21 @@ it('groups configured domains and shows redirect settings in the table', functio->and(substr_count($html, "id=\"service-domain-group-{$this->apiApp->id}\""))->toBe(1);});+it('removes consecutive service domains by stable row identity after indexes change', function () {+ $this->apiApp->update([+ 'fqdn' => 'https://first.example.com,https://second.example.com,https://third.example.com',+ ]);++ $component = Livewire::test(Domains::class, ['service' => $this->service->fresh(['applications', 'server'])]);++ $component+ ->call('removeDomainByKey', hash('sha256', 'https://first.example.com|'.$this->apiApp->id))+ ->call('removeDomainByKey', hash('sha256', 'https://second.example.com|'.$this->apiApp->id))+ ->assertDispatched('success');++ expect($this->apiApp->fresh()->fqdn)->toBe('https://third.example.com');+});+it('shows and persists the HTTP redirect control for HTTPS service applications', function () {Livewire::test(Domains::class, ['service' => $this->service->fresh(['applications', 'server'])])->assertSee('Redirect HTTP to HTTPS')diff --git a/tests/Feature/StableNestedLivewireKeysTest.php b/tests/Feature/StableNestedLivewireKeysTest.phpnew file mode 100644index 0000000000..c9b90bca99--- /dev/null+++ b/tests/Feature/StableNestedLivewireKeysTest.php@@ -0,0 +1,64 @@+<?php++it('does not key nested Livewire components by mutable list positions', function () {+ $postgresView = file_get_contents(resource_path('views/livewire/project/database/postgresql/general.blade.php'));+ $proxyView = file_get_contents(resource_path('views/livewire/server/proxy/dynamic-configurations.blade.php'));++ expect($postgresView)+ ->toContain(':wire:key="\'init-script-\'.md5($script[\'filename\'])"')+ ->not->toContain(':wire:key="$script[\'index\']"');++ expect($proxyView)+ ->toContain('wire:key="proxy-navbar-{{ $fileName }}"')+ ->not->toContain('wire:key="{{ $fileName }}-{{ $loop->index }}"');+});++it('saves reindexed PostgreSQL scripts by their original stable identity', function () {+ $editor = file_get_contents(app_path('Livewire/Project/Database/InitScript.php'));+ $parent = file_get_contents(app_path('Livewire/Project/Database/Postgresql/General.php'));++ expect($editor)+ ->toContain('public string $originalFilename;')+ ->toContain("dispatch('save_init_script', \$this->script, \$this->originalFilename)");++ expect($parent)+ ->toContain('public function save_init_script($script, string $originalFilename)')+ ->toContain("firstWhere('filename', \$originalFilename)");+});++it('keeps editable and refreshed list row keys independent of their positions', function () {+ $applicationDomains = file_get_contents(resource_path('views/livewire/project/application/partials/domain-row.blade.php'));+ $serviceDomains = file_get_contents(resource_path('views/livewire/project/service/partials/domain-table.blade.php'));+ $scheduledJobs = file_get_contents(resource_path('views/livewire/settings/scheduled-jobs.blade.php'));++ expect($applicationDomains)+ ->not->toContain('wire:key="domain-row-{{ $index }}-')+ ->toContain('wire:key="domain-row-{{ md5(');++ expect($serviceDomains)+ ->not->toContain('-{{ $index }}-')+ ->toContain('wire:key="svc-domain-{{ $row[\'service_application_id\'] ?? \'x\' }}-{{ md5(');++ expect($scheduledJobs)+ ->not->toContain('wire:key="run-{{ $loop->index }}"')+ ->not->toContain('wire:key="skip-{{ $loop->index }}"')+ ->toContain('wire:key="run-{{ md5(serialize($run)) }}"')+ ->toContain('wire:key="skip-{{ md5(serialize($skip)) }}"');+});++it('keys nested Livewire status components rendered inside navigation loops', function () {+ $sidebar = file_get_contents(resource_path('views/components/application/configuration-sidebar.blade.php'));++ expect($sidebar)+ ->toContain(':key="\'application-server-status-\'.$application->uuid"');+});++it('keys rolling log lines by content occurrence instead of list position', function () {+ $logs = file_get_contents(resource_path('views/livewire/project/shared/get-logs.blade.php'));++ expect($logs)+ ->toContain('$lineOccurrences = [];')+ ->toContain('$lineFingerprint = md5($line);')+ ->toContain('wire:key="log-{{ $lineFingerprint }}-{{ $lineOccurrence }}"')+ ->not->toContain("'line-' . \$index");+});diff --git a/tests/Feature/TeamScopedDestinationTest.php b/tests/Feature/TeamScopedDestinationTest.phpindex 3088fb4db3..be4ee0e4c8 100644--- a/tests/Feature/TeamScopedDestinationTest.php+++ b/tests/Feature/TeamScopedDestinationTest.php@@ -275,6 +275,23 @@ describe('StandaloneDocker/SwarmDocker ownedByCurrentTeam scope', function () {});describe('Destination/Show team scope', function () {+ test('deleting a destination redirects without rendering the deleted destination', function () {+ $destination = SwarmDocker::create([+ 'uuid' => fake()->uuid(),+ 'name' => 'swarm-a-'.fake()->unique()->word(),+ 'network' => 'swarm-a-'.fake()->unique()->word(),+ 'server_id' => $this->serverA->id,+ ]);++ $component = Livewire::test(DestinationShow::class, ['destination_uuid' => $destination->uuid])+ ->call('delete')+ ->assertRedirect(route('destination.index'));++ expect($component->effects)+ ->toHaveKey('redirectUsingNavigate', true);+ expect($destination->fresh())->toBeNull();+ });+test('mount with other team destination UUID redirects to index', function () {$component = Livewire::test(DestinationShow::class, ['destination_uuid' => $this->destinationB->uuid]);diff --git a/tests/Unit/ProductionImageWorkflowTest.php b/tests/Unit/ProductionImageWorkflowTest.phpindex d279087c2a..9af95fd066 100644--- a/tests/Unit/ProductionImageWorkflowTest.php+++ b/tests/Unit/ProductionImageWorkflowTest.php@@ -23,8 +23,8 @@ it('publishes v4 branch builds under the commit sha with a traceable internal ve->toContain('ARG COOLIFY_VERSION')->toContain('ENV COOLIFY_VERSION=${COOLIFY_VERSION}')->and($constants)- ->toContain("'version' => env('COOLIFY_VERSION') ?: '4.3.11'")- ->and($versions['coolify']['v4']['version'])->toBe('4.3.11')+ ->toContain("'version' => env('COOLIFY_VERSION') ?: '4.3.13'")+ ->and($versions['coolify']['v4']['version'])->toBe('4.3.13')->and($versions['coolify']['nightly']['version'])->toBe('4.4-rc.1')->and($nightlyVersions)->toBe($versions);});diff --git a/versions.json b/versions.jsonindex a9c5daea6a..a87ca37c50 100644--- a/versions.json+++ b/versions.json@@ -1,7 +1,7 @@{"coolify": {"v4": {- "version": "4.3.12"+ "version": "4.3.13"},"nightly": {"version": "4.4-rc.1"