-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Insufficient error handling in vendor/symfony/firebase-notifier/FirebaseTransport.php #42841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like this can be improved. Open for a PR? 😃 |
Honestly.. I don't know the Symfony coding or PR guidelines |
Its not that complicated 😉 Just have a look at https://symfony.com/doc/current/contributing/code/pull_requests.html and start contributing 😎 |
Just send a "normal PR" and we are happy to help you if something is missing. If you feel like you want to try sending a PR to Symfony another time, then just let this thread know so someone else can work on a fix. |
It's related to #42690, but I think there is still an issue (
|
…sport (villfa) This PR was merged into the 5.3 branch. Discussion ---------- [Notifier] Fix 'Undefined array key' error in FirebaseTransport | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #42841 | License | MIT | Doc PR | n/a This modification fixes a remaining `Undefined array key` error in *FirebaseTransport*. It also add a test to cover #42690. <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch 5.x. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry --> Commits ------- 53f836e [Notifier] Fix 'Undefined array key' error in FirebaseTransport
Symfony version(s) affected: 5.3.4
Symfony/firebase-notifier version(s) affected: 5.3.4
Description
Insufficient error handling in doSend() method in vendor/symfony/firebase-notifier/FirebaseTransport.php
How to reproduce
Send a firebase request with an timed out token
Possible Solution
Correct error verification to catch errors, also take return values failure/success into account
Additional context
The error catching part:
if ($jsonContents && isset($jsonContents['results']['error'])) { throw new TransportException('Unable to post the Firebase message: '.$jsonContents['error'], $response); }
Does not catch errors returned by firebase:
array:5 [ "multicast_id" => 0101010101010101010 "success" => 0 "failure" => 1 "canonical_ids" => 0 "results" => array:1 [ 0 => array:1 [ "error" => "NotRegistered" ] ] ]
The text was updated successfully, but these errors were encountered: