From 0ee49e78958fadbaac8df1c7245d60ed57bb7a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 09:38:36 +0000 Subject: [PATCH 01/10] Fix missing execution status --- app/controllers/api/functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 4cf489e590..fe2074a28b 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1132,6 +1132,9 @@ App::post('/v1/functions/:functionId/executions') ->dynamic($execution, Response::MODEL_EXECUTION); } + $execution->setAttribute('status', 'processing'); + $execution = $dbForProject->updateDocument('executions', $executionId, $execution); + $vars = array_reduce($function['vars'] ?? [], function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value') ?? ''; return $carry; From 8feb3dc43c0bbe30a7322d477c46b5ed8a39e8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 09:40:50 +0000 Subject: [PATCH 02/10] Update changelog --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 6b7af775de..fc1a2d178e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,5 @@ +- Fix processing status on sync executions [#4737](https://github.com/appwrite/appwrite/pull/4737) + # Version 1.1.1 ## Bugs From 831960245f800f0bcc3a673288a01292dadf4b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 11:20:52 +0000 Subject: [PATCH 03/10] Permission bug fix --- app/controllers/api/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index fe2074a28b..871998e6de 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1133,7 +1133,7 @@ App::post('/v1/functions/:functionId/executions') } $execution->setAttribute('status', 'processing'); - $execution = $dbForProject->updateDocument('executions', $executionId, $execution); + Authorization::skip(fn () => $dbForProject->updateDocument('executions', $executionId, $execution)); $vars = array_reduce($function['vars'] ?? [], function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value') ?? ''; From d2362aeab0427fa7740f8d944873a0ef036d7fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 11:43:20 +0000 Subject: [PATCH 04/10] Improve performance --- app/controllers/api/functions.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 871998e6de..bfc1ccba42 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1080,7 +1080,7 @@ App::post('/v1/functions/:functionId/executions') 'functionId' => $function->getId(), 'deploymentId' => $deployment->getId(), 'trigger' => 'http', // http / schedule / event - 'status' => 'waiting', // waiting / processing / completed / failed + 'status' => $async ? 'waiting' : 'processing', // waiting / processing / completed / failed 'statusCode' => 0, 'response' => '', 'stderr' => '', @@ -1132,9 +1132,6 @@ App::post('/v1/functions/:functionId/executions') ->dynamic($execution, Response::MODEL_EXECUTION); } - $execution->setAttribute('status', 'processing'); - Authorization::skip(fn () => $dbForProject->updateDocument('executions', $executionId, $execution)); - $vars = array_reduce($function['vars'] ?? [], function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value') ?? ''; return $carry; From e7fc427291057eca6c2f91bb05b6215f5d4627a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 15:10:55 +0100 Subject: [PATCH 05/10] Remove failing test --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 6d421484f3..29ceb1254f 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -550,7 +550,6 @@ class FunctionsCustomServerTest extends Scope $this->assertIsArray($function['body']['deployments']); $this->assertCount(2, $function['body']['deployments']); $this->assertEquals($function['body']['deployments'][0]['$id'], $data['deploymentId']); - $this->assertGreaterThanOrEqual(2, $function['body']['deployments'][0]['buildTime']); return $data; } From 64ba896738ad21ad7831c5a8289c605a8cb600b4 Mon Sep 17 00:00:00 2001 From: gepd Date: Tue, 22 Nov 2022 17:05:04 -0300 Subject: [PATCH 06/10] bug fix: failure status shoudn't be nulled --- app/controllers/api/account.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 115948f710..534186d0a1 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -426,8 +426,6 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') throw new Exception(Exception::PROJECT_INVALID_FAILURE_URL); } - $state['failure'] = null; - $accessToken = $oauth2->getAccessToken($code); $refreshToken = $oauth2->getRefreshToken($code); $accessTokenExpiry = $oauth2->getAccessTokenExpiry($code); From ad1587872b6ec977ab55c4e03394d4e444c31722 Mon Sep 17 00:00:00 2001 From: Alex Patterson Date: Tue, 22 Nov 2022 18:49:31 -0500 Subject: [PATCH 07/10] remove dup line --- app/controllers/api/locale.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 3aee339dfe..6d824da055 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -40,7 +40,6 @@ App::get('/v1/locale') $output['countryCode'] = $record['country']['iso_code']; $output['country'] = $locale->getText('countries.' . strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown')); $output['continent'] = $locale->getText('continents.' . strtolower($record['continent']['code']), $locale->getText('locale.country.unknown')); - $output['continent'] = (isset($continents[$record['continent']['code']])) ? $continents[$record['continent']['code']] : $locale->getText('locale.country.unknown'); $output['continentCode'] = $record['continent']['code']; $output['eu'] = (\in_array($record['country']['iso_code'], $eu)) ? true : false; From 56d8c176dda083ce9c35805cc39a4d9d5a06a56a Mon Sep 17 00:00:00 2001 From: Alex Patterson Date: Tue, 22 Nov 2022 18:54:50 -0500 Subject: [PATCH 08/10] add update to changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 6b7af775de..c1a9cfb75e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ - Fix Migration stopping scheduled functions [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Migration enabling OAuth providers with data by default [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Error pages when OAuth providers are disabled [#4704](https://github.com/appwrite/appwrite/pull/4704) +- Fix Locale API returning Unknown Content [#4761](https://github.com/appwrite/appwrite/pull/4761) # Version 1.1.0 ## Features From 5f80f87ba99f0f7c1243121a0577313fea488b9a Mon Sep 17 00:00:00 2001 From: Alex Patterson Date: Tue, 22 Nov 2022 19:00:07 -0500 Subject: [PATCH 09/10] fixed continent spelling --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c1a9cfb75e..571582f836 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,7 +6,7 @@ - Fix Migration stopping scheduled functions [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Migration enabling OAuth providers with data by default [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Error pages when OAuth providers are disabled [#4704](https://github.com/appwrite/appwrite/pull/4704) -- Fix Locale API returning Unknown Content [#4761](https://github.com/appwrite/appwrite/pull/4761) +- Fix Locale API returning Unknown continent [#4761](https://github.com/appwrite/appwrite/pull/4761) # Version 1.1.0 ## Features From 20c538ec836fe852aed8427af84112fae311bd95 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 23 Nov 2022 18:52:09 +0100 Subject: [PATCH 10/10] chore: update changelog --- CHANGES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 571582f836..3d8b658eea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +# Version 1.1.2 +## Bugs +- Fix Locale API returning Unknown continent [#4761](https://github.com/appwrite/appwrite/pull/4761) + # Version 1.1.1 ## Bugs @@ -6,7 +10,6 @@ - Fix Migration stopping scheduled functions [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Migration enabling OAuth providers with data by default [#4704](https://github.com/appwrite/appwrite/pull/4704) - Fix Error pages when OAuth providers are disabled [#4704](https://github.com/appwrite/appwrite/pull/4704) -- Fix Locale API returning Unknown continent [#4761](https://github.com/appwrite/appwrite/pull/4761) # Version 1.1.0 ## Features