From 0766cd935a008d17a1ee8ee7fdbfd58198b62e2a Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Tue, 3 Mar 2026 10:40:07 +0000 Subject: [PATCH] fix: skip paginated export for functions/sites with no active deployment When exportOnlyActive is true, functions/sites without an active deployment ID should be skipped entirely rather than falling back to the full paginated listing. --- src/Migration/Sources/Appwrite.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Migration/Sources/Appwrite.php b/src/Migration/Sources/Appwrite.php index a2edd3a2de..2844bcf105 100644 --- a/src/Migration/Sources/Appwrite.php +++ b/src/Migration/Sources/Appwrite.php @@ -1641,8 +1641,13 @@ class Appwrite extends Source /** @var Func $func */ $lastDocument = null; - if ($exportOnlyActive && $func->getActiveDeployment()) { - $deployment = $this->functions->getDeployment($func->getId(), $func->getActiveDeployment()); + if ($exportOnlyActive) { + $activeDeploymentId = $func->getActiveDeployment(); + if (empty($activeDeploymentId)) { + continue; // active-only mode: nothing to export for this function + } + + $deployment = $this->functions->getDeployment($func->getId(), $activeDeploymentId); try { $this->exportDeploymentData($func, $deployment); @@ -1863,8 +1868,13 @@ class Appwrite extends Source /** @var Site $site */ $lastDocument = null; - if ($exportOnlyActive && $site->getActiveDeployment()) { - $deployment = $this->sites->getDeployment($site->getId(), $site->getActiveDeployment()); + if ($exportOnlyActive) { + $activeDeploymentId = $site->getActiveDeployment(); + if (empty($activeDeploymentId)) { + continue; // active-only mode: nothing to export for this site + } + + $deployment = $this->sites->getDeployment($site->getId(), $activeDeploymentId); try { $this->exportSiteDeploymentData($site, $deployment);