From 97df10e6b8ae1db39c7644f943f17646661723de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 17 Oct 2022 11:45:38 +0000 Subject: [PATCH 1/2] Fix project pagination in usage containers --- CHANGES.md | 4 ++++ src/Appwrite/Usage/Calculators/Database.php | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 5e742d140..3856038c8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# Version 1.0.4 + +- Fix project pagination in DB usage collector [#X](X) + # Version 1.0.3 ## Bugs - Fix document audit deletion [#4429](https://github.com/appwrite/appwrite/pull/4429) diff --git a/src/Appwrite/Usage/Calculators/Database.php b/src/Appwrite/Usage/Calculators/Database.php index 74179fab0..85dcae319 100644 --- a/src/Appwrite/Usage/Calculators/Database.php +++ b/src/Appwrite/Usage/Calculators/Database.php @@ -132,7 +132,6 @@ class Database extends Calculator $results = []; $sum = $limit; $latestDocument = null; - $this->database->setNamespace('_' . $projectId); while ($sum === $limit) { try { @@ -140,6 +139,8 @@ class Database extends Calculator if ($latestDocument !== null) { $paginationQueries[] = Query::cursorAfter($latestDocument); } + + $this->database->setNamespace('_' . $projectId); $results = $this->database->find($collection, \array_merge($paginationQueries, $queries)); } catch (\Exception $e) { if (is_callable($this->errorHandler)) { From 837422145dbce146d62bebed8eca4cca35ace19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 17 Oct 2022 11:46:42 +0000 Subject: [PATCH 2/2] Update changelog url --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3856038c8..daee820eb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Version 1.0.4 -- Fix project pagination in DB usage collector [#X](X) +- Fix project pagination in DB usage collector [#4517](https://github.com/appwrite/appwrite/pull/4517) # Version 1.0.3 ## Bugs