From 3e1a1f45fdfa42294f97b74fac664d174098f397 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Tue, 11 Aug 2026 10:01:36 +0100 Subject: [PATCH] fix(deployments): reset event queue on intermediate chunk uploads Non-final chunks of a chunked deployment upload set no event params, so the API shutdown hook threw '[siteId] is missing from the params.' (InvalidArgumentException) on every intermediate chunk, aborting the remaining shutdown hooks for the request. The client still received its 202 (the response is flushed before shutdown), so this surfaced as a high-volume phantom 500 in telemetry rather than a failed upload. Reset the event queue when the upload is not yet complete, matching the existing idempotent-retry path. Co-Authored-By: Claude Fable 5 --- .../Platform/Modules/Functions/Http/Deployments/Create.php | 2 ++ src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php index 1b6093947f..9d69d9559a 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php @@ -347,6 +347,8 @@ class Create extends Action $queueForEvents ->setParam('functionId', $function->getId()) ->setParam('deploymentId', $deployment->getId()); + } else { + $queueForEvents->reset(); } $response diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php index 5fab6315cf..bf8d4948a6 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php @@ -420,6 +420,8 @@ class Create extends Action $queueForEvents ->setParam('siteId', $site->getId()) ->setParam('deploymentId', $deployment->getId()); + } else { + $queueForEvents->reset(); } $response