From d37378ec026865e70b83a5a68a330db998ffc929 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sun, 2 Nov 2025 18:29:26 +0100 Subject: [PATCH] fix: remove blocking instant_remote_process and hide button during download MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first click did nothing because instant_remote_process() blocked the Livewire response, preventing UI state updates. The button also remained visible during download, allowing multiple clicks. - Replace blocking instant_remote_process() with async command in queue - Add container cleanup to command queue with error suppression - Hide "Download & Prepare" button when s3DownloadInProgress is true - Button now properly disappears when clicked, preventing double-clicks - No more blocking operations in downloadFromS3() method 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/Livewire/Project/Database/Import.php | 7 ++----- resources/views/livewire/project/database/import.blade.php | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Livewire/Project/Database/Import.php b/app/Livewire/Project/Database/Import.php index ad018a1eb..bb4f755aa 100644 --- a/app/Livewire/Project/Database/Import.php +++ b/app/Livewire/Project/Database/Import.php @@ -394,12 +394,9 @@ public function downloadFromS3() // Create download directory on server $commands[] = "mkdir -p {$downloadDir}"; - // Check if container exists and remove it + // Check if container exists and remove it (done in the command queue to avoid blocking) $containerName = "s3-restore-{$this->resource->uuid}"; - $containerExists = instant_remote_process(["docker ps -a -q -f name={$containerName}"], $this->server, false); - if (filled($containerExists)) { - instant_remote_process(["docker rm -f {$containerName}"], $this->server, false); - } + $commands[] = "docker rm -f {$containerName} 2>/dev/null || true"; // Run MinIO client container to download file $commands[] = "docker run -d --name {$containerName} --rm -v {$downloadDir}:{$downloadDir} {$fullImageName} sleep 30"; diff --git a/resources/views/livewire/project/database/import.blade.php b/resources/views/livewire/project/database/import.blade.php index b8bed1d44..cc3032019 100644 --- a/resources/views/livewire/project/database/import.blade.php +++ b/resources/views/livewire/project/database/import.blade.php @@ -138,7 +138,7 @@ -
+
File found in S3 ({{ formatBytes($s3FileSize ?? 0) }})