From 7d42db82a0a219aba7ee4186798189ee295387f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 6 May 2024 15:05:13 +0000 Subject: [PATCH 1/2] Fix python failing logs --- src/Appwrite/Platform/Workers/Builds.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Appwrite/Platform/Workers/Builds.php b/src/Appwrite/Platform/Workers/Builds.php index ff1c439aa2..51674ca11d 100644 --- a/src/Appwrite/Platform/Workers/Builds.php +++ b/src/Appwrite/Platform/Workers/Builds.php @@ -433,6 +433,8 @@ class Builds extends Action throw new \Exception('Build not found', 404); } + $logs = \mb_substr($logs, 0, \mb_strlen($logs, 'UTF-8') - 1, 'UTF-8'); // Get only valid UTF8 part - removes leftover half-multibytes causing SQL errors + $build = $build->setAttribute('logs', $build->getAttribute('logs', '') . $logs); $build = $dbForProject->updateDocument('builds', $build->getId(), $build); From 8cc2530210374261d1d5ce406362394cacc16811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 9 May 2024 13:40:31 +0000 Subject: [PATCH 2/2] PR review changes --- src/Appwrite/Platform/Workers/Builds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Builds.php b/src/Appwrite/Platform/Workers/Builds.php index 51674ca11d..5ed7803d73 100644 --- a/src/Appwrite/Platform/Workers/Builds.php +++ b/src/Appwrite/Platform/Workers/Builds.php @@ -433,7 +433,7 @@ class Builds extends Action throw new \Exception('Build not found', 404); } - $logs = \mb_substr($logs, 0, \mb_strlen($logs, 'UTF-8') - 1, 'UTF-8'); // Get only valid UTF8 part - removes leftover half-multibytes causing SQL errors + $logs = \mb_substr($logs, 0, null, 'UTF-8'); // Get only valid UTF8 part - removes leftover half-multibytes causing SQL errors $build = $build->setAttribute('logs', $build->getAttribute('logs', '') . $logs); $build = $dbForProject->updateDocument('builds', $build->getId(), $build);