From 385e4e14b881d4755e7aa9bf5fd69a2f931b68ac Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 1 Jul 2025 17:33:11 +0530 Subject: [PATCH 1/4] add: delay, retries. --- .../Databases/DatabasesCustomServerTest.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index e84c760c86..b38b1202c6 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -1470,9 +1470,24 @@ class DatabasesCustomServerTest extends Scope $this->assertCount(64, $collection['body']['attributes']); $this->assertCount(0, $collection['body']['indexes']); - foreach ($collection['body']['attributes'] as $attribute) { - $this->assertEquals('available', $attribute['status'], 'attribute: ' . $attribute['key']); - } + $this->assertEventually(function () use ($databaseId, $collectionId) { + $collection = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + foreach ($collection['body']['attributes'] ?? [] as $attribute) { + $this->assertEquals( + 'available', + $attribute['status'], + 'attribute: ' . $attribute['key'] + ); + } + + return true; + }, 60000, 500); + // Test indexLimit = 64 // MariaDB, MySQL, and MongoDB create 6 indexes per new collection From 4d0bd1d74fb0d572b3838aca9526123f0a101e61 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 1 Jul 2025 18:10:19 +0530 Subject: [PATCH 2/4] add: delay, retries. --- tests/e2e/Services/Databases/DatabasesBase.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index e34691839d..a9a6c6e1db 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -1414,9 +1414,20 @@ trait DatabasesBase $this->assertEquals($releaseYearIndex['body']['key'], $movies['body']['indexes'][1]['key']); $this->assertEquals($releaseWithDate1['body']['key'], $movies['body']['indexes'][2]['key']); $this->assertEquals($releaseWithDate2['body']['key'], $movies['body']['indexes'][3]['key']); - foreach ($movies['body']['indexes'] as $index) { - $this->assertEquals('available', $index['status']); - } + + $this->assertEventually(function () use ($databaseId, $data) { + $movies = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + foreach ($movies['body']['indexes'] as $index) { + $this->assertEquals('available', $index['status']); + } + + return true; + }, 60000, 500); return $data; } From 99ccd64b4c9418c51e172857974b441b47cb4982 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 1 Jul 2025 18:24:05 -0400 Subject: [PATCH 3/4] =?UTF-8?q?Revert=20"chore:=20update=20composer.json?= =?UTF-8?q?=20and=20composer.lock=20to=20include=20appwrite-lab=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/users.php | 2 - composer.json | 2 +- composer.lock | 256 ++++++++++++-------------- src/Appwrite/GraphQL/Types/Mapper.php | 2 +- 4 files changed, 124 insertions(+), 138 deletions(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index b3ae17dc91..d7def69464 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -649,8 +649,6 @@ App::get('/v1/users') $total = $dbForProject->count('users', $filterQueries, APP_LIMIT_COUNT); } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } $response->dynamic(new Document([ 'users' => $users, diff --git a/composer.json b/composer.json index 073e667cdb..4c36ab125d 100644 --- a/composer.json +++ b/composer.json @@ -67,7 +67,7 @@ "utopia-php/platform": "0.7.*", "utopia-php/pools": "0.8.*", "utopia-php/preloader": "0.2.*", - "utopia-php/queue": "0.12.*", + "utopia-php/queue": "0.11.0", "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", diff --git a/composer.lock b/composer.lock index 985f2187b8..05c8a49512 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "beacba1fc087db3ab9f9d718b28c5876", + "content-hash": "55bc52686a08d64930e6af7411ac0654", "packages": [ { "name": "adhocore/jwt", @@ -67,99 +67,6 @@ ], "time": "2025-02-18T01:00:50+00:00" }, - { - "name": "appwrite-labs/php-amqplib", - "version": "0.1.1", - "source": { - "type": "git", - "url": "https://github.com/appwrite-labs/php-amqplib.git", - "reference": "bd380cbd63c8c0f063a3893b7a0b889d40876861" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/appwrite-labs/php-amqplib/zipball/bd380cbd63c8c0f063a3893b7a0b889d40876861", - "reference": "bd380cbd63c8c0f063a3893b7a0b889d40876861", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "ext-sockets": "*", - "php": "^7.2||^8.0", - "phpseclib/phpseclib": "^2.0|^3.0" - }, - "conflict": { - "php": "7.4.0 - 7.4.1" - }, - "replace": { - "php-amqplib/php-amqplib": "self.version", - "videlalvaro/php-amqplib": "self.version" - }, - "require-dev": { - "ext-curl": "*", - "nategood/httpful": "^0.2.20", - "phpunit/phpunit": "^7.5|^9.5", - "squizlabs/php_codesniffer": "^3.6", - "swoole/ide-helper": "^5.0" - }, - "suggest": { - "ext-swoole": "For Swoole coroutine support" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpAmqpLib\\": "PhpAmqpLib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1-or-later" - ], - "authors": [ - { - "name": "Appwrite Labs", - "email": "team@appwrite.io", - "role": "Fork Maintainer" - }, - { - "name": "Alvaro Videla", - "role": "Original Maintainer" - }, - { - "name": "Raúl Araya", - "email": "nubeiro@gmail.com", - "role": "Maintainer" - }, - { - "name": "Luke Bakken", - "email": "luke@bakken.io", - "role": "Maintainer" - }, - { - "name": "Ramūnas Dronga", - "email": "github@ramuno.lt", - "role": "Maintainer" - } - ], - "description": "Fork of php-amqplib with Swoole coroutine support. A pure PHP implementation of the AMQP protocol tested against RabbitMQ.", - "homepage": "https://github.com/appwrite-labs/php-amqplib/", - "keywords": [ - "async", - "coroutine", - "message", - "queue", - "rabbitmq", - "swoole" - ], - "support": { - "source": "https://github.com/appwrite-labs/php-amqplib/tree/0.1.1" - }, - "time": "2025-06-24T18:12:57+00:00" - }, { "name": "appwrite/appwrite", "version": "11.1.0", @@ -1728,6 +1635,87 @@ }, "time": "2020-10-15T08:29:30+00:00" }, + { + "name": "php-amqplib/php-amqplib", + "version": "v3.7.3", + "source": { + "type": "git", + "url": "https://github.com/php-amqplib/php-amqplib.git", + "reference": "9f50fe69a9f1a19e2cb25596a354d705de36fe59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/9f50fe69a9f1a19e2cb25596a354d705de36fe59", + "reference": "9f50fe69a9f1a19e2cb25596a354d705de36fe59", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-sockets": "*", + "php": "^7.2||^8.0", + "phpseclib/phpseclib": "^2.0|^3.0" + }, + "conflict": { + "php": "7.4.0 - 7.4.1" + }, + "replace": { + "videlalvaro/php-amqplib": "self.version" + }, + "require-dev": { + "ext-curl": "*", + "nategood/httpful": "^0.2.20", + "phpunit/phpunit": "^7.5|^9.5", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpAmqpLib\\": "PhpAmqpLib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "Alvaro Videla", + "role": "Original Maintainer" + }, + { + "name": "Raúl Araya", + "email": "nubeiro@gmail.com", + "role": "Maintainer" + }, + { + "name": "Luke Bakken", + "email": "luke@bakken.io", + "role": "Maintainer" + }, + { + "name": "Ramūnas Dronga", + "email": "github@ramuno.lt", + "role": "Maintainer" + } + ], + "description": "Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.", + "homepage": "https://github.com/php-amqplib/php-amqplib/", + "keywords": [ + "message", + "queue", + "rabbitmq" + ], + "support": { + "issues": "https://github.com/php-amqplib/php-amqplib/issues", + "source": "https://github.com/php-amqplib/php-amqplib/tree/v3.7.3" + }, + "time": "2025-02-18T20:11:13+00:00" + }, { "name": "php-http/discovery", "version": "1.20.0", @@ -1890,16 +1878,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.46", + "version": "3.0.45", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6" + "reference": "bd81b90d5963c6b9d87de50357585375223f4dd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", - "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/bd81b90d5963c6b9d87de50357585375223f4dd8", + "reference": "bd81b90d5963c6b9d87de50357585375223f4dd8", "shasum": "" }, "require": { @@ -1980,7 +1968,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.46" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.45" }, "funding": [ { @@ -1996,7 +1984,7 @@ "type": "tidelift" } ], - "time": "2025-06-26T16:29:55+00:00" + "time": "2025-06-22T22:54:43+00:00" }, { "name": "psr/container", @@ -2559,16 +2547,16 @@ }, { "name": "symfony/http-client", - "version": "v7.3.1", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "4403d87a2c16f33345dca93407a8714ee8c05a64" + "reference": "57e4fb86314015a695a750ace358d07a7e37b8a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/4403d87a2c16f33345dca93407a8714ee8c05a64", - "reference": "4403d87a2c16f33345dca93407a8714ee8c05a64", + "url": "https://api.github.com/repos/symfony/http-client/zipball/57e4fb86314015a695a750ace358d07a7e37b8a9", + "reference": "57e4fb86314015a695a750ace358d07a7e37b8a9", "shasum": "" }, "require": { @@ -2580,7 +2568,6 @@ }, "conflict": { "amphp/amp": "<2.5", - "amphp/socket": "<1.1", "php-http/discovery": "<1.15", "symfony/http-foundation": "<6.4" }, @@ -2593,6 +2580,7 @@ "require-dev": { "amphp/http-client": "^4.2.1|^5.0", "amphp/http-tunnel": "^1.0|^2.0", + "amphp/socket": "^1.1", "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", @@ -2634,7 +2622,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.3.1" + "source": "https://github.com/symfony/http-client/tree/v7.3.0" }, "funding": [ { @@ -2650,7 +2638,7 @@ "type": "tidelift" } ], - "time": "2025-06-28T07:58:39+00:00" + "time": "2025-05-02T08:23:16+00:00" }, { "name": "symfony/http-client-contracts", @@ -2972,16 +2960,16 @@ }, { "name": "tbachert/spi", - "version": "v1.0.5", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/Nevay/spi.git", - "reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002" + "reference": "506a79c98e1a51522e76ee921ccb6c62d52faf3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nevay/spi/zipball/e7078767866d0a9e0f91d3f9d42a832df5e39002", - "reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002", + "url": "https://api.github.com/repos/Nevay/spi/zipball/506a79c98e1a51522e76ee921ccb6c62d52faf3a", + "reference": "506a79c98e1a51522e76ee921ccb6c62d52faf3a", "shasum": "" }, "require": { @@ -2999,7 +2987,7 @@ "extra": { "class": "Nevay\\SPI\\Composer\\Plugin", "branch-alias": { - "dev-main": "1.0.x-dev" + "dev-main": "0.2.x-dev" }, "plugin-optional": true }, @@ -3018,9 +3006,9 @@ ], "support": { "issues": "https://github.com/Nevay/spi/issues", - "source": "https://github.com/Nevay/spi/tree/v1.0.5" + "source": "https://github.com/Nevay/spi/tree/v1.0.3" }, - "time": "2025-06-29T15:42:06+00:00" + "time": "2025-04-02T19:38:14+00:00" }, { "name": "thecodingmachine/safe", @@ -4111,16 +4099,16 @@ }, { "name": "utopia-php/platform", - "version": "0.7.9", + "version": "0.7.8", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "b061f523513b071ef7168e6dc1441364eb73f308" + "reference": "e3a4536c46f10988b1a446ec6b8dd8a9914be854" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/b061f523513b071ef7168e6dc1441364eb73f308", - "reference": "b061f523513b071ef7168e6dc1441364eb73f308", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/e3a4536c46f10988b1a446ec6b8dd8a9914be854", + "reference": "e3a4536c46f10988b1a446ec6b8dd8a9914be854", "shasum": "" }, "require": { @@ -4129,7 +4117,7 @@ "php": ">=8.0", "utopia-php/cli": "0.15.*", "utopia-php/framework": "0.33.*", - "utopia-php/queue": "^0.12.0" + "utopia-php/queue": "0.11.*" }, "require-dev": { "laravel/pint": "1.*", @@ -4155,9 +4143,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.7.9" + "source": "https://github.com/utopia-php/platform/tree/0.7.8" }, - "time": "2025-06-24T20:21:05+00:00" + "time": "2025-05-30T10:05:43+00:00" }, { "name": "utopia-php/pools", @@ -4266,21 +4254,21 @@ }, { "name": "utopia-php/queue", - "version": "0.12.0", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "3a7603ee712c592bfc54af4a76f0426c428b5574" + "reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/3a7603ee712c592bfc54af4a76f0426c428b5574", - "reference": "3a7603ee712c592bfc54af4a76f0426c428b5574", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5", + "reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5", "shasum": "" }, "require": { - "appwrite-labs/php-amqplib": "^0.1", "php": ">=8.3", + "php-amqplib/php-amqplib": "^3.7", "utopia-php/cli": "0.15.*", "utopia-php/fetch": "0.4.*", "utopia-php/framework": "0.33.*", @@ -4326,9 +4314,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.12.0" + "source": "https://github.com/utopia-php/queue/tree/0.11.0" }, - "time": "2025-06-24T18:58:38+00:00" + "time": "2025-05-30T09:52:38+00:00" }, { "name": "utopia-php/registry", @@ -7267,16 +7255,16 @@ }, { "name": "symfony/console", - "version": "v7.3.1", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9e27aecde8f506ba0fd1d9989620c04a87697101" + "reference": "66c1440edf6f339fd82ed6c7caa76cb006211b44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9e27aecde8f506ba0fd1d9989620c04a87697101", - "reference": "9e27aecde8f506ba0fd1d9989620c04a87697101", + "url": "https://api.github.com/repos/symfony/console/zipball/66c1440edf6f339fd82ed6c7caa76cb006211b44", + "reference": "66c1440edf6f339fd82ed6c7caa76cb006211b44", "shasum": "" }, "require": { @@ -7341,7 +7329,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.3.1" + "source": "https://github.com/symfony/console/tree/v7.3.0" }, "funding": [ { @@ -7357,7 +7345,7 @@ "type": "tidelift" } ], - "time": "2025-06-27T19:55:54+00:00" + "time": "2025-05-24T10:34:04+00:00" }, { "name": "symfony/filesystem", diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 347642e5a1..3c7915bc96 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -226,7 +226,7 @@ class Mapper ]; if (!$rule['required']) { - $fields[$escapedKey]['defaultValue'] = $rule['default'] ?? null; + $fields[$escapedKey]['defaultValue'] = $rule['default']; } } From 1cd69e26f884bbf532fc32a329880e90a18cc143 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 1 Jul 2025 18:24:52 -0400 Subject: [PATCH 4/4] =?UTF-8?q?Reapply=20"chore:=20update=20composer.json?= =?UTF-8?q?=20and=20composer.lock=20to=20include=20appwrite-lab=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 99ccd64b4c9418c51e172857974b441b47cb4982. --- app/controllers/api/users.php | 2 ++ src/Appwrite/GraphQL/Types/Mapper.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index d7def69464..b3ae17dc91 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -649,6 +649,8 @@ App::get('/v1/users') $total = $dbForProject->count('users', $filterQueries, APP_LIMIT_COUNT); } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } $response->dynamic(new Document([ 'users' => $users, diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 3c7915bc96..347642e5a1 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -226,7 +226,7 @@ class Mapper ]; if (!$rule['required']) { - $fields[$escapedKey]['defaultValue'] = $rule['default']; + $fields[$escapedKey]['defaultValue'] = $rule['default'] ?? null; } }