From a941d8b8557fd5bc1339ba0cc4b2d1f66d996c12 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 13 Apr 2026 13:42:38 +0100 Subject: [PATCH] fix: trim execution queue payload to project ID only The v1-executions queue was serialising the full project document (OAuth providers, webhooks, keys, auths config, permissions, etc.) into every message. The worker DI system already re-fetches the complete project from the platform database using only the project ID, so the full document was wasted bytes. Override trimPayload() in the Execution event class to include only $id in the project stub, reducing message size significantly. Co-Authored-By: Claude Sonnet 4.6 --- src/Appwrite/Event/Execution.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Appwrite/Event/Execution.php b/src/Appwrite/Event/Execution.php index 398025565c..9e735991ba 100644 --- a/src/Appwrite/Event/Execution.php +++ b/src/Appwrite/Event/Execution.php @@ -53,4 +53,23 @@ class Execution extends Event 'execution' => $this->execution, ]; } + + /** + * Trim payload for the execution event. + * Only the project ID is needed — the worker DI fetches the full project from the platform database. + * + * @return array + */ + protected function trimPayload(): array + { + $trimmed = []; + + if ($this->project) { + $trimmed['project'] = new Document([ + '$id' => $this->project->getId(), + ]); + } + + return $trimmed; + } }