From 9e21c5f58d3f2db8151fe57e9eb4421a9106a1dd Mon Sep 17 00:00:00 2001 From: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:31:16 -0700 Subject: [PATCH 1/4] Fix function trigger Functions created by schedule or event should have the respective trigger. --- app/workers/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/functions.php b/app/workers/functions.php index aaad7d237e..9fa1c7df16 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -106,7 +106,7 @@ Server::setResource('execute', function () { 'functionId' => $function->getId(), 'deploymentInternalId' => $deployment->getInternalId(), 'deploymentId' => $deployment->getId(), - 'trigger' => 'http', + 'trigger' => $trigger, 'status' => 'processing', 'responseStatusCode' => 0, 'responseHeaders' => [], From 1e990ce12f84baa42f8f95e775cf7ef7b1e27b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 7 Sep 2023 09:24:04 +0200 Subject: [PATCH 2/4] linter fix --- src/Appwrite/Migration/Version/V19.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index 896fc816a8..f528f4450b 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -56,15 +56,15 @@ class V19 extends Migration if ($domain->getAttribute('verification', false)) { $status = 'verified'; } - + $projectId = $domain->getAttribute('projectId'); $projectInternalId = $domain->getAttribute('projectInternalId'); - + if (empty($projectId) || empty($projectInternalId)) { Console::warning("Error migrating domain {$domain->getAttribute('domain')}: Missing projectId or projectInternalId"); continue; } - + $ruleDocument = new Document([ 'projectId' => $domain->getAttribute('projectId'), 'projectInternalId' => $domain->getAttribute('projectInternalId'), @@ -75,7 +75,7 @@ class V19 extends Migration 'status' => $status, 'certificateId' => $domain->getAttribute('certificateId'), ]); - + try { $this->consoleDB->createDocument('rules', $ruleDocument); } catch (\Throwable $th) { From 418c8e37644195d1649897e19dbf925a6ba0209c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 7 Sep 2023 11:33:42 +0200 Subject: [PATCH 3/4] Fix redeploys --- app/controllers/api/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index a1263ced35..1cabc77eb7 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1458,6 +1458,7 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/builds/:buildId') $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ '$id' => $deploymentId, + '$internalId' => '', 'buildId' => '', 'buildInternalId' => '', 'entrypoint' => $function->getAttribute('entrypoint'), From 410072882d16a3a56ac20da96de899f47cccbee8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 7 Sep 2023 12:00:53 -0400 Subject: [PATCH 4/4] Fix guests missing global scope --- app/config/roles.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/config/roles.php b/app/config/roles.php index a4f05808fd..65d5694bbf 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -66,6 +66,7 @@ return [ Auth::USER_ROLE_GUESTS => [ 'label' => 'Guests', 'scopes' => [ + 'global', 'public', 'home', 'console',