From dc64fe85e981060465126047eb39ee03371805f6 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 12 Dec 2024 17:46:04 +0200 Subject: [PATCH 1/3] payload bug fix --- src/Appwrite/Platform/Workers/Usage.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Usage.php b/src/Appwrite/Platform/Workers/Usage.php index cdbb7b5aaa..5d97e64b38 100644 --- a/src/Appwrite/Platform/Workers/Usage.php +++ b/src/Appwrite/Platform/Workers/Usage.php @@ -59,7 +59,14 @@ class Usage extends Action throw new Exception('Missing payload'); } - $project = new Document($payload['project'] ?? []); + $document = $payload['project'] ?? []; + + if(empty($document)){ + var_dump($payload); + return; + } + + $project = new Document($document); $projectId = $project->getInternalId(); foreach ($payload['reduce'] ?? [] as $document) { if (empty($document)) { From c5605ac8be2a1c51e5fe0e09760cc95304363b67 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 12 Dec 2024 17:46:27 +0200 Subject: [PATCH 2/3] payload bug fix --- src/Appwrite/Platform/Workers/Usage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Usage.php b/src/Appwrite/Platform/Workers/Usage.php index 5d97e64b38..eb7b75fd96 100644 --- a/src/Appwrite/Platform/Workers/Usage.php +++ b/src/Appwrite/Platform/Workers/Usage.php @@ -59,9 +59,9 @@ class Usage extends Action throw new Exception('Missing payload'); } - $document = $payload['project'] ?? []; + $document = $payload['project'] ?? []; - if(empty($document)){ + if (empty($document)) { var_dump($payload); return; } From 158954df0bbd66b2d84a4639e09bff0a3d39ceaf Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 12 Dec 2024 18:55:45 +0200 Subject: [PATCH 3/3] Usage payload debug --- src/Appwrite/Platform/Workers/Usage.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Usage.php b/src/Appwrite/Platform/Workers/Usage.php index eb7b75fd96..98b2ea32c7 100644 --- a/src/Appwrite/Platform/Workers/Usage.php +++ b/src/Appwrite/Platform/Workers/Usage.php @@ -63,7 +63,6 @@ class Usage extends Action if (empty($document)) { var_dump($payload); - return; } $project = new Document($document);