diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 6634ebee75..bc68676b61 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -179,6 +179,9 @@ App::error() ->inject('request') ->inject('dbForProject') ->action(function (App $utopia, throwable $error, Request $request, Database $dbForProject) { + var_dump("App::error"); + var_dump("getCode=" . $error->getCode()); + var_dump($error->getMessage()); if ($error instanceof Timeout) { var_dump("App::error() in in in in in in in in in in in in in"); var_dump($request->getParams()); @@ -2102,7 +2105,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') } $filterQueries = Query::groupByType($queries)['filters']; - $timeoutMilliseconds = 200; + $timeoutMilliseconds = 200; // todo: make this configurable if ($documentSecurity && !$valid) { $documents = $dbForProject->find('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, $timeoutMilliseconds); @@ -2112,8 +2115,6 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') $total = Authorization::skip(fn () => $dbForProject->count('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $filterQueries, APP_LIMIT_COUNT)); } - throw new Timeout('Timeout'); // Force Exception..... - /** * Reset $collection attribute to remove prefix. */ diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index caa1492a1e..0a5255b442 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -995,11 +995,13 @@ trait DatabasesBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'queries' => ['orderAsc("releaseYear")', 'sleep(1)'], + 'queries' => ['sleep("$id", 1)'], ]); -die; + var_dump($documents); + die; + $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'],