8000 bug #42690 [Notifier] Firebase error handling (mishaklomp) · symfony/symfony@8a33e05 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a33e05

Browse files
committed
bug #42690 [Notifier] Firebase error handling (mishaklomp)
This PR was merged into the 5.3 branch. Discussion ---------- [Notifier] Firebase error handling | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #42211 | License | MIT | Doc PR | symfony/symfony-docs I found a bug in the Firebase error handling, resulting in a `Undefined index: message_id ` error. It occurred when trying to send a notification to an unregistered device token. As I stated in my issue before. Don't know if this (little) change should include any tests? This is my first PR, so any feedback is welcome! Commits ------- ac9c306 [Notifier] fix firebase error handling so the transports doesn't try setting the success message, that doesn't exists.
2 parents 15e6f7e + ac9c306 commit 8a33e05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Notifier/Bridge/Firebase/FirebaseTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ protected function doSend(MessageInterface $message): SentMessage
8989

9090
throw new TransportException('Unable to post the Firebase message: '.$errorMessage, $response);
9191
}
92-
if ($jsonContents && isset($jsonContents['results']['error'])) {
93-
throw new TransportException('Unable to post the Firebase message: '.$jsonContents['error'], $response);
92+
if ($jsonContents && isset($jsonContents['results'][0]['error'])) {
93+
throw new TransportException('Unable to post the Firebase message: '.$jsonContents['results'][0]['error'], $response);
9494
}
9595

9696
$success = $response->toArray(false);

0 commit comments

Comments
 (0)
0