diff --git a/app/workers/functions.php b/app/workers/functions.php index 52c3df4fb1..f1970b1962 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -334,16 +334,16 @@ class FunctionsV1 extends Worker ->setParam('projectId', $projectId) ->setParam('userId', $userId) ->setParam('webhooks', $webhooks) - ->setParam('event', 'functions.executions.update') + ->setParam('event', $event) ->setParam('eventData', $execution->getArrayCopy(array_keys($executionModel->getRules()))); $executionUpdate->trigger(); /** Trigger realtime event */ - $target = Realtime::fromPayload('functions.executions.update', $execution); + $target = Realtime::fromPayload($event, $execution); Realtime::send( projectId: $projectId, payload: $execution->getArrayCopy(), - event: 'functions.executions.update', + event: $event, channels: $target['channels'], roles: $target['roles'] ); diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index 4f930ed6b5..94db8cc15a 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -476,7 +476,7 @@ class WebhooksCustomServerTest extends Scope $execution = $this->client->call(Client::METHOD_POST, '/functions/'.$data['functionId'].'/executions', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), ['executionId' => 'unique()',]); + ], $this->getHeaders()), []); $this->assertEquals($execution['headers']['status-code'], 201); $this->assertNotEmpty($execution['body']['$id']);