diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index feed820e15..99730d475f 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -264,7 +264,7 @@ class Messaging extends Action } } } catch (\Throwable $e) { - $deliveryErrors[] = 'Failed sending to targets ' . $batchIndex + 1 . '-' . \count($batch) . ' with error: ' . $e->getMessage(); + $deliveryErrors[] = 'Failed sending to targets ' . $batchIndex + 1 . ' of ' . \count($batch) . ' with error: ' . $e->getMessage(); } finally { $batchIndex++; @@ -288,6 +288,10 @@ class Messaging extends Action $deliveryErrors = \array_merge($deliveryErrors, $result['deliveryErrors']); } + if (empty($deliveryErrors) && $deliveredTotal === 0) { + $deliveryErrors[] = 'Unknown error'; + } + $message->setAttribute('deliveryErrors', $deliveryErrors); if (\count($message->getAttribute('deliveryErrors')) > 0) {