From be76990bb65ab13b7a911a8a945ce6d3ddabb57d Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Sun, 22 Mar 2026 18:50:03 +0100 Subject: [PATCH] fix: fail open realtime publishing --- src/Appwrite/Event/Realtime.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Appwrite/Event/Realtime.php b/src/Appwrite/Event/Realtime.php index 419863191e..747fd786f9 100644 --- a/src/Appwrite/Event/Realtime.php +++ b/src/Appwrite/Event/Realtime.php @@ -4,6 +4,7 @@ namespace Appwrite\Event; use Appwrite\Messaging\Adapter; use Appwrite\Messaging\Adapter\Realtime as RealtimeAdapter; +use Utopia\Console; use Utopia\Database\Document; use Utopia\Database\Exception; @@ -96,17 +97,21 @@ class Realtime extends Event : [$target['projectId'] ?? $this->getProject()->getId()]; foreach ($projectIds as $projectId) { - $this->realtime->send( - projectId: $projectId, - payload: $this->getRealtimePayload(), - events: $allEvents, - channels: $target['channels'], - roles: $target['roles'], - options: [ - 'permissionsChanged' => $target['permissionsChanged'], - 'userId' => $this->getParam('userId') - ] - ); + try { + $this->realtime->send( + projectId: $projectId, + payload: $this->getRealtimePayload(), + events: $allEvents, + channels: $target['channels'], + roles: $target['roles'], + options: [ + 'permissionsChanged' => $target['permissionsChanged'], + 'userId' => $this->getParam('userId') + ] + ); + } catch (\Exception $e) { + Console::error('Realtime send failed: '.$e->getMessage()); + } } return true;