fix: fail open realtime publishing

This commit is contained in:
loks0n
2026-03-22 18:50:03 +01:00
parent 6e59e1307d
commit be76990bb6
+16 -11
View File
@@ -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;