From 85b5328f2ecf12f81f1fe7e58f80fc81f4ae30f6 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 1 Jun 2026 13:24:32 +0100 Subject: [PATCH] chore: always record database namespace/tenant in deleteByGroup Namespace and tenant describe the database regardless of outcome, so record them (along with the target collection) up front instead of only on the error path. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Platform/Modules/Databases/Workers/Databases.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php index 702d33c2f0..89181bfd39 100644 --- a/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php +++ b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php @@ -612,6 +612,10 @@ class Databases extends Action */ protected function deleteByGroup(string $collectionId, array $queries, Database $database, ?callable $callback = null): void { + Span::add('database.namespace', $database->getNamespace()); + Span::add('database.tenant', $database->getTenant()); + Span::add('delete_by_group.collection', $collectionId); + try { $count = $database->deleteDocuments( $collectionId, @@ -620,11 +624,6 @@ class Databases extends Action $callback ); } catch (\Throwable $th) { - Span::add('database.namespace', $database->getNamespace()); - if ($database->getSharedTables()) { - Span::add('database.tenant', $database->getTenant()); - } - Span::add('delete_by_group.collection', $collectionId); Span::add('delete_by_group.error', $th->getMessage()); return; }