From 04f8018c3b988c162cee4fc263be6e412c37e1f0 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 27 Jan 2026 05:32:15 +0100 Subject: [PATCH] fix(command-bus): handle deleted files in getPendingCommands --- .../src/AsyncCommandRepositories/FileCommandRepository.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/command-bus/src/AsyncCommandRepositories/FileCommandRepository.php b/packages/command-bus/src/AsyncCommandRepositories/FileCommandRepository.php index 84ebdfb1e1..b7759e9822 100644 --- a/packages/command-bus/src/AsyncCommandRepositories/FileCommandRepository.php +++ b/packages/command-bus/src/AsyncCommandRepositories/FileCommandRepository.php @@ -53,6 +53,10 @@ public function getPendingCommands(): array { return arr(glob(__DIR__ . '/../stored-commands/*.pending.txt')) ->mapWithKeys(function (string $path) { + if (! Filesystem\is_file($path)) { + return; + } + $uuid = str_replace('.pending.txt', '', pathinfo($path, PATHINFO_BASENAME)); $payload = Filesystem\read_file($path);