mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: update Sequence validator, fix messaging race condition, improve auth retry
- Update utopia-php/database to fix Sequence validator rejecting integer $sequence values on MongoDB (VAR_UUID7) adapters - Fix Base.php Filter constructor passing APP_DATABASE_QUERY_MAX_VALUES as $idAttributeType instead of the correct Database::VAR_INTEGER - Fix Messaging testUpdateScheduledAt race condition by increasing initial scheduledAt from 3s to 30s so scheduler doesn't fire before the PATCH update processes - Improve Functions callWithAuthRetry to refresh project credentials after 4 consecutive 401 failures and increase max retries to 10 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
5cf272b21a
commit
f7ba5e39b7
@@ -24,10 +24,17 @@ trait FunctionsBase
|
||||
*/
|
||||
protected function callWithAuthRetry(string $method, string $path, array $headers, mixed $params = []): array
|
||||
{
|
||||
$maxRetries = 8;
|
||||
$maxRetries = 10;
|
||||
$response = null;
|
||||
|
||||
for ($attempt = 1; $attempt <= $maxRetries; $attempt++) {
|
||||
// Refresh project credentials after several failed attempts
|
||||
if ($attempt === 5) {
|
||||
$project = $this->getProject(true);
|
||||
$headers['x-appwrite-project'] = $project['$id'];
|
||||
$headers['x-appwrite-key'] = $project['apiKey'];
|
||||
}
|
||||
|
||||
$response = $this->client->call($method, $path, array_merge($headers), $params);
|
||||
|
||||
if ($response['headers']['status-code'] !== 401) {
|
||||
|
||||
@@ -1245,13 +1245,13 @@ trait MessagingBase
|
||||
'targets' => [$targetId],
|
||||
'subject' => 'New blog post',
|
||||
'content' => 'Check out the new blog post at http://localhost',
|
||||
'scheduledAt' => DateTime::addSeconds(new \DateTime(), 3),
|
||||
'scheduledAt' => DateTime::addSeconds(new \DateTime(), 30),
|
||||
]);
|
||||
|
||||
$this->assertEquals(201, $message['headers']['status-code']);
|
||||
$this->assertEquals(MessageStatus::SCHEDULED, $message['body']['status']);
|
||||
|
||||
$scheduledAt = DateTime::addSeconds(new \DateTime(), 10);
|
||||
$scheduledAt = DateTime::addSeconds(new \DateTime(), 15);
|
||||
|
||||
$message = $this->client->call(Client::METHOD_PATCH, '/messaging/messages/email/' . $message['body']['$id'], [
|
||||
'content-type' => 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user