Merge branch '1.7.x' into chore-update-env-var-used-for-domain

This commit is contained in:
Khushboo Verma 2025-07-03 00:02:51 +05:30
commit 253195698e
5 changed files with 36 additions and 8 deletions

View file

@ -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,

View file

@ -226,7 +226,7 @@ class Mapper
];
if (!$rule['required']) {
$fields[$escapedKey]['defaultValue'] = $rule['default'];
$fields[$escapedKey]['defaultValue'] = $rule['default'] ?? null;
}
}

View file

@ -445,7 +445,7 @@ class Builds extends Action
Console::execute('rsync -av --exclude \'.git\' ' . \escapeshellarg($tmpTemplateDirectory . '/' . $templateRootDirectory . '/') . ' ' . \escapeshellarg($tmpDirectory . '/' . $rootDirectory), '', $stdout, $stderr);
// Commit and push
$exit = Console::execute('git config --global user.email "team@appwrite.io" && git config --global user.name "Appwrite" && cd ' . \escapeshellarg($tmpDirectory) . ' && git add . && git commit -m "Create ' . \escapeshellarg($resource->getAttribute('name', '')) . ' function" && git push origin ' . \escapeshellarg($branchName), '', $stdout, $stderr);
$exit = Console::execute('git config --global user.email "team@appwrite.io" && git config --global user.name "Appwrite" && cd ' . \escapeshellarg($tmpDirectory) . ' && git checkout -b ' . \escapeshellarg($branchName) . ' && git add . && git commit -m "Create ' . \escapeshellarg($resource->getAttribute('name', '')) . ' function" && git push origin ' . \escapeshellarg($branchName), '', $stdout, $stderr);
if ($exit !== 0) {
throw new \Exception('Unable to push code repository: ' . $stderr);

View file

@ -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;
}

View file

@ -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