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);