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

[9.x] Update pusher-php-server to 5.x #36344

Closed
wants to merge 2 commits into from
Closed

[9.x] Update pusher-php-server to 5.x #36344

wants to merge 2 commits into from

Conversation

Koozza
Copy link

@Koozza Koozza commented Feb 22, 2021

This is my first PR for laravel, so I'm not sure if I did this right. This PR allows the usage of pusher PHP server 5.x. I don't think it's backwards compatible with 4.x

Made after issue: #36339

@driesvints driesvints changed the title Update pusher-php-server to 5.x [9.x] Update pusher-php-server to 5.x Feb 22, 2021
@GrahamCampbell
Copy link
Member

Why not support both version 4 and 5, and larger Laravel 8?

@taylorotwell
Copy link
Member

5 is totally broken for me... 4 works:

image

@taylorotwell
Copy link
Member

Raised issue here: pusher/pusher-http-php#283

@taylorotwell
Copy link
Member

@Koozza did you actually test this and prove it was working on your end?

@Koozza
Copy link
Author

Koozza commented Feb 22, 2021

@GrahamCampbell I'd love to support 4.x as well but I don't know how to achieve that. 5.x has a changed trigger signature and in additon a changed response.

@taylorotwell I did test this after appling a fix to the 5.x branch of the php-pusher package. I also created a PR for that package solving the issue you've mentioned above: pusher/pusher-http-php#281

@WillSewell
Copy link

Issue is fixed in pusher/pusher-http-php#281, which has been released in v5.0.1.

@taylorotwell
Copy link
Member

I brought this change into 8.x and supported both 4 and 5.

@Koozza
Copy link
Author

Koozza commented Feb 22, 2021

Thanks!

@Koozza Koozza deleted the add-pusher-5.x-support branch February 23, 2021 07:10
@vesper8
Copy link

vesper8 commented Feb 24, 2021

I'm still getting this error after updating to pusher 5.0.1. Laravel v8.29.0

   ErrorException

  get_object_vars() expects parameter 1 to be object, array given

  at vendor/pusher/pusher-php-server/src/Pusher.php:539
    535▕
    536▕         $result = json_decode($response['body']);
    537▕
    538▕         if (property_exists($result, 'channels')) {
  ➜ 539▕             $result->channels = get_object_vars($result->channels);
    540▕         }
    541▕
    542▕         return $result;
    543▕     }

Reverting to ^4.0 for now

@Koozza
Copy link
Author

Koozza commented Feb 24, 2021

@vesper8 are you by any chance connecting to a laravel-pusher (beyondcode) server?

@vesper8
Copy link

vesper8 commented Feb 24, 2021

@Koozza yes I am

@Koozza
Copy link
Author

Koozza commented Feb 24, 2021

I opened a PR there as well: beyondcode/laravel-websockets#698

The problemen is that their HTTP response doesn't matches Pushers.

@vesper8
Copy link

vesper8 commented Feb 24, 2021

@Koozza thank you! Will subscribe to that and keep an eye out for a new version

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

Successfully merging this pull request may close these issues.

5 participants