From cdc44230cfc51a70b4e2a381da4e33766d26912a Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Tue, 7 Jun 2022 14:01:12 +0200 Subject: [PATCH 1/6] Fix execution delays --- src/Executor/Executor.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 82b09ffe6b..2762a1d7ff 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -186,10 +186,18 @@ class Executor ); $response = $this->call(self::METHOD_POST, $route, $headers, $params, true, $requestTimeout); $status = $response['headers']['status-code']; + + if($status < 400) { + return $response['body']; + } break; case $status === 406: $response = $this->call(self::METHOD_POST, $route, $headers, $params, true, $requestTimeout); $status = $response['headers']['status-code']; + + if($status < 400) { + return $response['body']; + } break; default: throw new \Exception($response['body']['message'], $status); From ce59bcce7af718904ef377f23854dd152e6ffb41 Mon Sep 17 00:00:00 2001 From: Matej Baco Date: Wed, 8 Jun 2022 09:10:44 +0200 Subject: [PATCH 2/6] Linter fix --- src/Executor/Executor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 2762a1d7ff..416d47ab82 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -187,7 +187,7 @@ class Executor $response = $this->call(self::METHOD_POST, $route, $headers, $params, true, $requestTimeout); $status = $response['headers']['status-code']; - if($status < 400) { + if ($status < 400) { return $response['body']; } break; @@ -195,7 +195,7 @@ class Executor $response = $this->call(self::METHOD_POST, $route, $headers, $params, true, $requestTimeout); $status = $response['headers']['status-code']; - if($status < 400) { + if ($status < 400) { return $response['body']; } break; From 6c7a6dcd8b4257bdb8a0920d73f635b531430052 Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 9 Jun 2022 18:15:34 +0300 Subject: [PATCH 3/6] null on default tests --- tests/e2e/Services/Database/DatabaseBase.php | 23 ++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Database/DatabaseBase.php b/tests/e2e/Services/Database/DatabaseBase.php index f59e5ad56b..47aa3ce351 100644 --- a/tests/e2e/Services/Database/DatabaseBase.php +++ b/tests/e2e/Services/Database/DatabaseBase.php @@ -118,6 +118,15 @@ trait DatabaseBase 'required' => true, ]); + $duration = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'duration', + 'required' => false, + ]); + $actors = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/attributes/string', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -140,6 +149,11 @@ trait DatabaseBase $this->assertEquals($releaseYear['body']['type'], 'integer'); $this->assertEquals($releaseYear['body']['required'], true); + $this->assertEquals($duration['headers']['status-code'], 201); + $this->assertEquals($duration['body']['key'], 'duration'); + $this->assertEquals($duration['body']['type'], 'integer'); + $this->assertEquals($duration['body']['required'], false); + $this->assertEquals($actors['headers']['status-code'], 201); $this->assertEquals($actors['body']['key'], 'actors'); $this->assertEquals($actors['body']['type'], 'string'); @@ -157,10 +171,11 @@ trait DatabaseBase ]), []); $this->assertIsArray($movies['body']['attributes']); - $this->assertCount(3, $movies['body']['attributes']); + $this->assertCount(4, $movies['body']['attributes']); $this->assertEquals($movies['body']['attributes'][0]['key'], $title['body']['key']); $this->assertEquals($movies['body']['attributes'][1]['key'], $releaseYear['body']['key']); - $this->assertEquals($movies['body']['attributes'][2]['key'], $actors['body']['key']); + $this->assertEquals($movies['body']['attributes'][2]['key'], $duration['body']['key']); + $this->assertEquals($movies['body']['attributes'][3]['key'], $actors['body']['key']); return $data; } @@ -748,6 +763,7 @@ trait DatabaseBase 'data' => [ 'title' => 'Spider-Man: Homecoming', 'releaseYear' => 2017, + 'duration' => 0, 'actors' => [ 'Tom Holland', 'Zendaya Maree Stoermer', @@ -757,6 +773,7 @@ trait DatabaseBase 'write' => ['user:' . $this->getUser()['$id']], ]); + $document4 = $this->client->call(Client::METHOD_POST, '/database/collections/' . $data['moviesId'] . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -783,6 +800,7 @@ trait DatabaseBase $this->assertEquals($document2['headers']['status-code'], 201); $this->assertEquals($document2['body']['title'], 'Spider-Man: Far From Home'); $this->assertEquals($document2['body']['releaseYear'], 2019); + $this->assertEquals($document2['body']['duration'], null); $this->assertIsArray($document2['body']['$read']); $this->assertIsArray($document2['body']['$write']); $this->assertCount(1, $document2['body']['$read']); @@ -795,6 +813,7 @@ trait DatabaseBase $this->assertEquals($document3['headers']['status-code'], 201); $this->assertEquals($document3['body']['title'], 'Spider-Man: Homecoming'); $this->assertEquals($document3['body']['releaseYear'], 2017); + $this->assertEquals($document3['body']['duration'], 0); $this->assertIsArray($document3['body']['$read']); $this->assertIsArray($document3['body']['$write']); $this->assertCount(1, $document3['body']['$read']); From 8b1860d5ecd39b6c1ca590a246b23d5644ec3137 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Jun 2022 06:53:52 +0000 Subject: [PATCH 4/6] Bump guzzlehttp/guzzle from 7.4.3 to 7.4.4 Bumps [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) from 7.4.3 to 7.4.4. - [Release notes](https://github.com/guzzle/guzzle/releases) - [Changelog](https://github.com/guzzle/guzzle/blob/master/CHANGELOG.md) - [Commits](https://github.com/guzzle/guzzle/compare/7.4.3...7.4.4) --- updated-dependencies: - dependency-name: guzzlehttp/guzzle dependency-type: indirect ... Signed-off-by: dependabot[bot] --- composer.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/composer.lock b/composer.lock index f9dcd577cd..77a95ecc29 100644 --- a/composer.lock +++ b/composer.lock @@ -481,16 +481,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.3", + "version": "7.4.4", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab" + "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", - "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/e3ff079b22820c2029d4c2a87796b6a0b8716ad8", + "reference": "e3ff079b22820c2029d4c2a87796b6a0b8716ad8", "shasum": "" }, "require": { @@ -585,7 +585,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.3" + "source": "https://github.com/guzzle/guzzle/tree/7.4.4" }, "funding": [ { @@ -601,7 +601,7 @@ "type": "tidelift" } ], - "time": "2022-05-25T13:24:33+00:00" + "time": "2022-06-09T21:39:15+00:00" }, { "name": "guzzlehttp/promises", @@ -689,16 +689,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.2.1", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2" + "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/c94a94f120803a18554c1805ef2e539f8285f9a2", - "reference": "c94a94f120803a18554c1805ef2e539f8285f9a2", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/83260bb50b8fc753c72d14dc1621a2dac31877ee", + "reference": "83260bb50b8fc753c72d14dc1621a2dac31877ee", "shasum": "" }, "require": { @@ -722,7 +722,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -784,7 +784,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.2.1" + "source": "https://github.com/guzzle/psr7/tree/2.3.0" }, "funding": [ { @@ -800,7 +800,7 @@ "type": "tidelift" } ], - "time": "2022-03-20T21:55:58+00:00" + "time": "2022-06-09T08:26:02+00:00" }, { "name": "influxdb/influxdb-php", @@ -1639,25 +1639,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -1686,7 +1686,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1" }, "funding": [ { @@ -1702,7 +1702,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/polyfill-ctype", From 775721abdbc5b06c012d96e26a79d7b598325ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 10 Jun 2022 10:31:37 +0000 Subject: [PATCH 5/6] Fix default payload --- app/executor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/executor.php b/app/executor.php index 83f83e6b54..73fddc9680 100644 --- a/app/executor.php +++ b/app/executor.php @@ -434,7 +434,7 @@ App::post('/v1/execution') ->desc('Create an execution') ->param('runtimeId', '', new Text(64), 'The runtimeID to execute.') ->param('vars', [], new Assoc(), 'Environment variables required for the build.') - ->param('data', '{}', new Text(8192), 'Data to be forwarded to the function, this is user specified.', true) + ->param('data', '', new Text(8192), 'Data to be forwarded to the function, this is user specified.', true) ->param('timeout', 15, new Range(1, (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900)), 'Function maximum execution time in seconds.') ->inject('activeRuntimes') ->inject('response') From 7d3fbfb311a725bc61f6cebdc33982209de6b59d Mon Sep 17 00:00:00 2001 From: Marc-Antoine Thevenet Date: Fri, 10 Jun 2022 15:53:45 +0200 Subject: [PATCH 6/6] Update fr.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ##EASY FIX following previous [PR #3340](https://github.com/appwrite/appwrite/pull/3340) Here's a new try for Typo fix + 🇫🇷 t9n updated... Thanks and hope it will pass the test 😟 --- app/config/locale/translations/fr.json | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/app/config/locale/translations/fr.json b/app/config/locale/translations/fr.json index 704cf619e4..f5cc15a83a 100644 --- a/app/config/locale/translations/fr.json +++ b/app/config/locale/translations/fr.json @@ -5,8 +5,8 @@ "emails.sender": "Équipe %s", "emails.verification.subject": "Vérification du compte", "emails.verification.hello": "Bonjour {{name}}", - "emails.verification.body": "Suivez ce lien pour vérifier votre adresse mail.", - "emails.verification.footer": "Si vous n'avez pas demandé à vérifier cette adresse mail, vous pouvez ignorer ce message.", + "emails.verification.body": "Suivez ce lien pour vérifier votre adresse e-mail.", + "emails.verification.footer": "Si vous n'avez pas demandé à vérifier cette adresse, vous pouvez ignorer ce message.", "emails.verification.thanks": "Merci", "emails.verification.signature": "Équipe {{project}}", "emails.magicSession.subject": "Connexion", @@ -14,19 +14,25 @@ "emails.magicSession.body": "Suivez ce lien pour vous connecter.", "emails.magicSession.footer": "Si vous n'avez pas demandé à vous connecter en utilisant cet e-mail, vous pouvez ignorer ce message.", "emails.magicSession.thanks": "Merci", - "emails.magicSession.signature": "Réinitialisation du mot de passe", - "emails.recovery.subject": "Bonjour {{name}}", + "emails.magicSession.signature": "L'équipe {{project}}", + "emails.recovery.subject": "Réinitialisation du mot de passe", "emails.recovery.hello": "Bonjour {{name}}", - "emails.recovery.body": "Suivez ce lien pour réinitialiser votre mot de passe de {{projet}}.", + "emails.recovery.body": "Suivez ce lien pour réinitialiser votre mot de passe pour {{projet}}.", "emails.recovery.footer": "Si vous n'avez pas demandé à réinitialiser votre mot de passe, vous pouvez ignorer ce message.", "emails.recovery.thanks": "Merci", - "emails.recovery.signature": "Équipe {{project}}", + "emails.recovery.signature": "L'équipe {{project}}", "emails.invitation.subject": "Invitation à l'équipe %s de %s", "emails.invitation.hello": "Bonjour", - "emails.invitation.body": "Ce mail vous a été envoyé parce que {{owner}} voulait vous inviter à devenir membre de l'équipe {{team}} de {{project}}.", + "emails.invitation.body": "Cet e-mail vous a été envoyé parce que {{owner}} souhaite vous inviter à devenir membre de l'équipe {{team}} pour {{project}}.", "emails.invitation.footer": "Si vous n'êtes pas intéressé, vous pouvez ignorer ce message.", "emails.invitation.thanks": "Merci", - "emails.invitation.signature": "Équipe {{project}}", + "emails.invitation.signature": "L'équipe {{project}}", + "emails.certificate.subject": "Échec du certificat pour %s", + "emails.certificate.hello": "Bonjour", + "emails.certificate.body": "Le certificate pour votre domaine '{{domain}}' n'a pas pu être généré. Ceci est la tentative {{tentative}} et l'échec a été causé par : {{erreur}}", + "emails.certificate.footer": "Votre certificat précédent sera valide pendant 30 jours à compter de la première défaillance. Nous vous recommandons fortement d'enquêter sur ce cas, sinon votre domaine se retrouvera sans communication SSL valide.", + "emails.certificate.thanks": "Merci", + "emails.certificate.signature": "L'équipe {{project}}", "locale.country.unknown": "Inconnu", "countries.af": "Afghanistan", "countries.ao": "Angola", @@ -229,4 +235,4 @@ "continents.na": "Amérique du Nord", "continents.oc": "Océanie", "continents.sa": "Amérique du Sud" -} \ No newline at end of file +}