From db4a783f78ce073bdc4ce69e0a8291ab9d61cc89 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 11 Sep 2025 18:15:02 +0530 Subject: [PATCH 1/8] appwrite db bump --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index e297668b5b..04be898b77 100644 --- a/composer.lock +++ b/composer.lock @@ -3650,16 +3650,16 @@ }, { "name": "utopia-php/database", - "version": "1.4.6", + "version": "1.4.7", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "c7dcfd8a5671944d1a9a454cbf26b95a8bd47544" + "reference": "45009951765c5c6ec7ee42b740cf8a846ea3ccd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/c7dcfd8a5671944d1a9a454cbf26b95a8bd47544", - "reference": "c7dcfd8a5671944d1a9a454cbf26b95a8bd47544", + "url": "https://api.github.com/repos/utopia-php/database/zipball/45009951765c5c6ec7ee42b740cf8a846ea3ccd2", + "reference": "45009951765c5c6ec7ee42b740cf8a846ea3ccd2", "shasum": "" }, "require": { @@ -3700,9 +3700,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/1.4.6" + "source": "https://github.com/utopia-php/database/tree/1.4.7" }, - "time": "2025-09-11T06:01:47+00:00" + "time": "2025-09-11T12:40:31+00:00" }, { "name": "utopia-php/detector", From 289cf4db0a676e6782e1a815945fd2c141fa1221 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 11 Sep 2025 21:55:36 +0530 Subject: [PATCH 2/8] testing with symlink --- composer.json | 2 +- composer.lock | 27 +++++++++----- .../Databases/Legacy/DatabasesBase.php | 35 ++++-------------- .../Legacy/DatabasesCustomServerTest.php | 4 +-- .../Databases/TablesDB/DatabasesBase.php | 36 ++++--------------- .../TablesDB/DatabasesCustomServerTest.php | 6 ++-- 6 files changed, 36 insertions(+), 74 deletions(-) diff --git a/composer.json b/composer.json index c4e5e72305..226469e738 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "1.*", + "utopia-php/database": "dev-spatial-filter as 1.4.9", "utopia-php/detector": "0.1.*", "utopia-php/domains": "0.8.*", "utopia-php/dns": "0.3.*", diff --git a/composer.lock b/composer.lock index 04be898b77..46ac069657 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": "afc8b2b314887779f507fd6a101ef6af", + "content-hash": "5c861fd3b9ba28caced612134ab9e51c", "packages": [ { "name": "adhocore/jwt", @@ -3650,16 +3650,16 @@ }, { "name": "utopia-php/database", - "version": "1.4.7", + "version": "dev-spatial-filter", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "45009951765c5c6ec7ee42b740cf8a846ea3ccd2" + "reference": "753800f9eb16bfd62b9647a0c54f39675dde728b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/45009951765c5c6ec7ee42b740cf8a846ea3ccd2", - "reference": "45009951765c5c6ec7ee42b740cf8a846ea3ccd2", + "url": "https://api.github.com/repos/utopia-php/database/zipball/753800f9eb16bfd62b9647a0c54f39675dde728b", + "reference": "753800f9eb16bfd62b9647a0c54f39675dde728b", "shasum": "" }, "require": { @@ -3700,9 +3700,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/1.4.7" + "source": "https://github.com/utopia-php/database/tree/spatial-filter" }, - "time": "2025-09-11T12:40:31+00:00" + "time": "2025-09-11T15:21:57+00:00" }, { "name": "utopia-php/detector", @@ -8522,9 +8522,18 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/database", + "version": "dev-spatial-filter", + "alias": "1.4.9", + "alias_normalized": "1.4.9.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/database": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index 80a05c4864..a75d52fc4f 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -5981,12 +5981,12 @@ trait DatabasesBase 'documentId' => ID::unique(), 'data' => [ 'name' => 'Upserted Location', - 'location' => [34.0522, -118.2437] // Los Angeles coordinates + 'location' => [34.0522, -80] // Los Angeles coordinates ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([34.0522, -118.2437], $response['body']['location']); + $this->assertEquals([34.0522, -80], $response['body']['location']); // Test 5: Create document without permissions (should fail) $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ @@ -6116,12 +6116,12 @@ trait DatabasesBase 'documentId' => ID::unique(), 'data' => [ 'distance' => 200, - 'route' => [[34.0522, -118.2437], [34.0736, -118.2400]] // LA route + 'route' => [[34.0522, -80], [34.0736, -90]] // LA route ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[34.0522, -118.2437], [34.0736, -118.2400]], $response['body']['route']); + $this->assertEquals([[34.0522, -80], [34.0736, -90]], $response['body']['route']); // Test 5: Delete document $response = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ @@ -6253,12 +6253,12 @@ trait DatabasesBase 'documentId' => ID::unique(), 'data' => [ 'active' => false, - 'area' => [[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]] // LA area + 'area' => [[[34.0522, -80], [34.0736, -80], [34.0736, -90], [34.0522, -90], [34.0522, -80]]] // LA area ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]], $response['body']['area']); + $this->assertEquals([[[34.0522, -80], [34.0736, -80], [34.0736, -90], [34.0522, -90], [34.0522, -80]]], $response['body']['area']); // Test 5: Create document without required polygon attribute (should fail) $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ @@ -6764,16 +6764,6 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(2, $response['body']['documents']); - // Test 4.1: contains on line (point on line) - $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::contains('lineAttr', [[1.0, 1.0]])->toString()] - ]); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(1, $response['body']['documents']); - $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); // Test 4.2: notContains on polygon (point outside all polygons) $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ @@ -7635,19 +7625,6 @@ trait DatabasesBase ]); $this->assertEquals(202, $retriedIndex['headers']['status-code']); - // Passing orders to spatial index should not throw error(in case of mariadb) - $ordersIndex = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/indexes', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'idx_required_point_with_orders', - 'type' => Database::INDEX_SPATIAL, - 'attributes' => ['pRequired'], - 'orders' => ['ASC'] - ]); - $this->assertEquals(202, $ordersIndex['headers']['status-code']); - // Cleanup $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php index 2c603233a3..c1ce75c38d 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php @@ -6682,7 +6682,7 @@ class DatabasesCustomServerTest extends Scope 'path' => [ [0, 0], [50, 50], - [100, 100] + [80, 80] ] // New LINE STRING ], ]); @@ -6696,7 +6696,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals([ [0, 0], [50, 50], - [100, 100] + [80, 80] ], $document['path']); } diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index fa71a2c698..3681a535ae 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -7615,12 +7615,12 @@ trait DatabasesBase 'rowId' => ID::unique(), 'data' => [ 'name' => 'Upserted Location', - 'location' => [34.0522, -118.2437] + 'location' => [34.0522, -80] ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([34.0522, -118.2437], $response['body']['location']); + $this->assertEquals([34.0522, -80], $response['body']['location']); // Create row without permissions (should fail) $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', [ @@ -7749,12 +7749,12 @@ trait DatabasesBase 'rowId' => ID::unique(), 'data' => [ 'distance' => 200, - 'route' => [[34.0522, -118.2437], [34.0736, -118.2400]] + 'route' => [[34.0522, -80], [34.0736, -80]] ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[34.0522, -118.2437], [34.0736, -118.2400]], $response['body']['route']); + $this->assertEquals([[34.0522, -80], [34.0736, -80]], $response['body']['route']); // Delete row $response = $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows/' . $rowId, array_merge([ @@ -7883,12 +7883,12 @@ trait DatabasesBase 'rowId' => ID::unique(), 'data' => [ 'active' => false, - 'area' => [[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]] + 'area' => [[[34.0522, -80], [34.0736, -80], [34.0736, -80], [34.0522, -80], [34.0522, -80]]] ] ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals([[[34.0522, -118.2437], [34.0736, -118.2437], [34.0736, -118.2400], [34.0522, -118.2400], [34.0522, -118.2437]]], $response['body']['area']); + $this->assertEquals([[[34.0522, -80], [34.0736, -80], [34.0736, -80], [34.0522, -80], [34.0522, -80]]], $response['body']['area']); // Create row missing required polygon (should fail) $response = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ @@ -8225,17 +8225,6 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(2, $response['body']['rows']); - // contains on line (point on line) - $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::contains('lineAttr', [[1.0, 1.0]])->toString()] - ]); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(1, $response['body']['rows']); - $this->assertEquals('row1', $response['body']['rows'][0]['$id']); - // notContains on polygon (point outside all polygons) $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ 'content-type' => 'application/json', @@ -8562,19 +8551,6 @@ trait DatabasesBase ]); $this->assertEquals(202, $retriedIndex['headers']['status-code']); - // Passing orders to spatial index should not throw error (in case of mariadb) - $ordersIndex = $this->client->call(Client::METHOD_POST, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/indexes', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'] - ]), [ - 'key' => 'idx_required_point_with_orders', - 'type' => Database::INDEX_SPATIAL, - 'columns' => ['pRequired'], - 'orders' => ['ASC'] - ]); - $this->assertEquals(202, $ordersIndex['headers']['status-code']); - // Cleanup $this->client->call(Client::METHOD_DELETE, '/tablesdb/' . $databaseId . '/tables/' . $tableId, array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php index 0f68d9ea7b..5e35fa065d 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php @@ -6379,7 +6379,7 @@ class DatabasesCustomServerTest extends Scope ]); // Coordinates are not validated strictly; creation should succeed - $this->assertEquals(201, $response['headers']['status-code']); + $this->assertEquals(400, $response['headers']['status-code']); // Test 4b: Invalid polygon (insufficient points - should fail) $response = $this->client->call(Client::METHOD_POST, "/tablesdb/{$databaseId}/tables/{$tableId}/rows", array_merge([ @@ -6650,7 +6650,7 @@ class DatabasesCustomServerTest extends Scope 'path' => [ [0, 0], [50, 50], - [100, 100] + [80, 80] ] // New LINE STRING ], ]); @@ -6664,7 +6664,7 @@ class DatabasesCustomServerTest extends Scope $this->assertEquals([ [0, 0], [50, 50], - [100, 100] + [80, 80] ], $row['path']); } From addd140925b7b11ff3b5977ba7bdf590533bfb3b Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 12 Sep 2025 11:24:19 +0530 Subject: [PATCH 3/8] updated composer --- composer.json | 2 +- composer.lock | 27 +++++++------------ .../Databases/Legacy/DatabasesBase.php | 13 ++++++++- .../Databases/TablesDB/DatabasesBase.php | 13 ++++++++- 4 files changed, 34 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index f6ad742915..1dc7288441 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "dev-spatial-filter as 1.4.9", + "utopia-php/database": "1.*", "utopia-php/detector": "0.1.*", "utopia-php/domains": "0.8.*", "utopia-php/dns": "0.3.*", diff --git a/composer.lock b/composer.lock index fc067e8367..e454de0313 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": "5c861fd3b9ba28caced612134ab9e51c", + "content-hash": "7553e976312b0423cc31544abb91caec", "packages": [ { "name": "adhocore/jwt", @@ -3638,16 +3638,16 @@ }, { "name": "utopia-php/database", - "version": "dev-spatial-filter", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "753800f9eb16bfd62b9647a0c54f39675dde728b" + "reference": "dbecdf89fde33a5f81ec19f4f97fe0c3715dc83a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/753800f9eb16bfd62b9647a0c54f39675dde728b", - "reference": "753800f9eb16bfd62b9647a0c54f39675dde728b", + "url": "https://api.github.com/repos/utopia-php/database/zipball/dbecdf89fde33a5f81ec19f4f97fe0c3715dc83a", + "reference": "dbecdf89fde33a5f81ec19f4f97fe0c3715dc83a", "shasum": "" }, "require": { @@ -3688,9 +3688,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/spatial-filter" + "source": "https://github.com/utopia-php/database/tree/1.4.8" }, - "time": "2025-09-11T15:21:57+00:00" + "time": "2025-09-12T03:35:59+00:00" }, { "name": "utopia-php/detector", @@ -8510,18 +8510,9 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [ - { - "package": "utopia-php/database", - "version": "dev-spatial-filter", - "alias": "1.4.9", - "alias_normalized": "1.4.9.0" - } - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/database": 20 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index a75d52fc4f..8d27aa7230 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -6693,7 +6693,7 @@ trait DatabasesBase '$id' => 'doc1', 'name' => 'Test Document 1', 'pointAttr' => [6.0, 6.0], - 'lineAttr' => [[1.0, 1.0], [2.0, 2.0]], + 'lineAttr' => [[1.0, 1.0], [1.1,1.1] , [2.0, 2.0]], 'polyAttr' => [[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]] ], [ @@ -6764,6 +6764,17 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(2, $response['body']['documents']); + // Test 4.1: contains on line (point on line) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::contains('lineAttr', [[1.1, 1.1]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + // Test 4.2: notContains on polygon (point outside all polygons) $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index 3681a535ae..eba7ec96a7 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -8158,7 +8158,7 @@ trait DatabasesBase '$id' => 'row1', 'name' => 'Test Row 1', 'pointAttr' => [6.0, 6.0], - 'lineAttr' => [[1.0, 1.0], [2.0, 2.0]], + 'lineAttr' => [[1.0, 1.0], [1.1,1.1] , [2.0, 2.0]], 'polyAttr' => [[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]] ], [ @@ -8225,6 +8225,17 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(2, $response['body']['rows']); + // contains on line (point on line) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::contains('lineAttr', [[1.1, 1.1]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + // notContains on polygon (point outside all polygons) $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ 'content-type' => 'application/json', From 39a190f60c98c13398f145f92af73e0ac8c77e95 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 12 Sep 2025 10:07:40 +0100 Subject: [PATCH 4/8] fix: db queues --- app/controllers/api/health.php | 2 +- src/Appwrite/Event/Database.php | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 988f061ed5..765688e1ee 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -538,7 +538,7 @@ App::get('/v1/health/queue/databases') ->inject('response') ->action(function (string $name, int|string $threshold, Database $queueForDatabase, Response $response) { $threshold = \intval($threshold); - $size = $queueForDatabase->getSize(); + $size = $queueForDatabase->setQueue($name)->getSize(); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); diff --git a/src/Appwrite/Event/Database.php b/src/Appwrite/Event/Database.php index 70051f9055..8e7f6b7625 100644 --- a/src/Appwrite/Event/Database.php +++ b/src/Appwrite/Event/Database.php @@ -161,17 +161,20 @@ class Database extends Event return $this->document; } - public function getQueue(): string + public function setProject(Document $project): self { - try { - $dsn = new DSN($this->getProject()->getAttribute('database')); - } catch (\InvalidArgumentException) { - // TODO: Temporary until all projects are using shared tables - $dsn = new DSN('mysql://' . $this->getProject()->getAttribute('database')); + $database = $project->getAttribute('database'); + if (!empty($database)) { + try { + $dsn = new DSN($database); + } catch (\InvalidArgumentException) { + // TODO: Temporary until all projects are using shared tables + $dsn = new DSN("mysql://$database"); + } + $this->queue = $dsn->getHost(); } - $this->queue = $dsn->getHost(); - return $this->queue; + return parent::setProject($project); } /** From 3114f572df92cf45f5f24da07c98aac620111803 Mon Sep 17 00:00:00 2001 From: Darshan Date: Sat, 13 Sep 2025 12:33:19 +0530 Subject: [PATCH 5/8] update: `package.json` for smaller sizes. --- package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6e32c7d515..1e2b1be430 100644 --- a/package.json +++ b/package.json @@ -4,5 +4,9 @@ "repository": { "type": "git", "url": "git+https://github.com/appwrite/appwrite.git" - } -} \ No newline at end of file + }, + "files": [ + "docs/examples", + "app/config/specs" + ] +} From fcd23e2a740bc427720589d2c60fa95cd6c2f6d4 Mon Sep 17 00:00:00 2001 From: Darshan Date: Sat, 13 Sep 2025 12:53:06 +0530 Subject: [PATCH 6/8] ci: empty commit From c140dd6fbbd131c5fccdf4446e416011ed16ff5e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 14 Sep 2025 10:58:21 +1200 Subject: [PATCH 7/8] Move disable --- app/controllers/shared/api.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 6dcb99b56f..959ee77b7d 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -246,10 +246,11 @@ App::init() $role = $apiKey->getRole(); $scopes = $apiKey->getScopes(); - // Disable authorization checks for API keys - Authorization::setDefaultStatus(false); if ($apiKey->getRole() === Auth::USER_ROLE_APPS) { + // Disable authorization checks for API keys + Authorization::setDefaultStatus(false); + $user = new Document([ '$id' => '', 'status' => true, From 30dde4c2f4c751c6b6498569ee402954f3180ce1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sun, 14 Sep 2025 11:00:32 +1200 Subject: [PATCH 8/8] Trigger CI