Skip to content
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

Report reason message get truncated #237

Open
10 of 15 tasks
yllumi opened this issue Jun 13, 2019 · 3 comments
Open
10 of 15 tasks

Report reason message get truncated #237

yllumi opened this issue Jun 13, 2019 · 3 comments

Comments

@yllumi
Copy link

yllumi commented Jun 13, 2019

NOTE: Please test in a least two browsers (i.e. Chrome and Firefox). This
helps with diagnosing problems quicker.

Please confirm the following:

  • I have read the README entirely
  • I have verified in the issues that my problem hasn't already been resolved

Setup

  • Operating System: Linux Mint
  • PHP Version: 7.2
  • web-push-php Version: 5.2.4

Please check that you have installed and enabled these PHP extensions :

  • gmp
  • mbstring
  • curl
  • openssl

Please select any browsers that you are experiencing problems with:

  • Chrome
  • Firefox
  • Firefox for Mobile
  • Opera for Android
  • Samsung Internet Browser
  • Other

Problem

When I use the wrong subscription for sending web push, $report->getReason() were truncated, like this:

Client error: `POST https://fcm.googleapis.com/fcm/send/eWp764UJNBM:APA91bHJVQXmxU9-Yr5j1VjxAZcJBWlvGRCRZjU4H7Z5_glrAc1O6R7o4w-UzTFdalqXEYZHJgxMjTrbXCCkAtKmaFqi_UnZ7MdPrbGJvcUyGNVTpGbYBf8EazF1TBVa3yHS1k5wR3qc` resulted in a `403 Forbidden` response:\nthe key in the authorization header does not correspond to the sender ID used to subscribe this user. Please ensure you (truncated...)\n

Expected

The error message should not truncated.

Features Used

  • VAPID Support
  • GCM API Key
  • Sending with Payload

Example / Reproduce Case

Send notification with wrong subscription data with this format:

[
          'subscription' => Subscription::create([ // this is the structure for the working draft from october 2018 (https://www.w3.org/TR/2018/WD-push-api-20181026/) 
              "endpoint" => "https://example.com/other/endpoint/of/another/vendor/abcdef...",
              "keys" => [
                  'p256dh' => '(stringOf88Chars)',
                  'auth' => '(stringOf24Chars)'
              ],
          ]),
          'payload' => '{msg:"Hello World!"}',
      ],

but with wrong subscription. Program should showing error message that truncated.

Other

When I search from internet, message gets truncated because of calling $reason->getMessage() at WebPush class line 180. When I change it to $reason->getResponse()->getBody()->getContents() I get complete message but without mentioning endpoint.

@developergb19
Copy link

Hi. During sending the notifications we also get a lot of error messages with code 403. All solutions that we found in the Net leads us to GCM. It's not clear for us what is really happening. Should we unsubscribe the subscriber or should we retry sending notifications. Also according to the UserAgent information all subscribers with those errors use Chrome browser on Android OS. If anyone have some thoughts or infrmation about situation like this please HELP to resolve it.

@alfredobarron
Copy link

I have the same problem, any solution?

@Isaac-Amponsah
Copy link

I had the same problem but was solved after generating new vapid keys, I don't really know what I did wrong with the previous keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants