From 1ac35054fe0eddfb07de5a95317144b6c2c50294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 17 Sep 2025 18:26:19 +0200 Subject: [PATCH] FIx missing event data; improve test --- .../Modules/Proxy/Http/Rules/Verification/Update.php | 4 ++-- tests/e2e/Services/Proxy/ProxyCustomServerTest.php | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Verification/Update.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Verification/Update.php index 14472a72e6..091dea266b 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Verification/Update.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Verification/Update.php @@ -78,6 +78,8 @@ class Update extends Action throw new Exception(Exception::RULE_NOT_FOUND); } + $queueForEvents->setParam('ruleId', $rule->getId()); + if ($rule->getAttribute('status', '') !== RULE_STATUS_VERIFICATION_FAILED) { return $response->dynamic($rule, Response::MODEL_PROXY_RULE); } @@ -106,8 +108,6 @@ class Update extends Action ])) ->trigger(); - $queueForEvents->setParam('ruleId', $rule->getId()); - // Fill response model $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); diff --git a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php index 522547e837..da7c161042 100644 --- a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php +++ b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php @@ -582,6 +582,14 @@ class ProxyCustomServerTest extends Scope $this->assertEquals(201, $rule['headers']['status-code']); $this->assertEquals(RULE_STATUS_GENERATING_CERTIFICATE, $rule['body']['status']); $this->assertEmpty($rule['body']['verificationLogs']); + $this->assertNotEmpty($rule['body']['$id']); + $ruleId = $rule['body']['$id']; + + $rule = $this->updateRuleVerification($ruleId); + $this->assertEquals(200, $rule['headers']['status-code']); + $this->assertEquals($ruleId, $rule['body']['$id']); + $this->assertEquals(RULE_STATUS_GENERATING_CERTIFICATE, $rule['body']['status']); + $this->assertEmpty($rule['body']['verificationLogs']); $this->cleanupRule($rule['body']['$id']); $this->cleanupSite($siteId);