pusher / pusher-http-php

PHP library for interacting with the Pusher Channels HTTP API
https://pusher.com/docs/server_api_guide
1.42k stars 309 forks source link

Upgrading from 7.0.2 to 7.2.0 breaks broadcasting events in laravel #357

Closed kukumagi closed 2 years ago

kukumagi commented 2 years ago

After upgrading to 7.2.0 My laravel broadcast events stopped triggering from pusher. Rollbacking to 7.0.2 version fixed my problem.

Not sure wether it causes this problem because Im using laravel-websockets?

Calling pusher manually also did not broadcast

" // New Pusher instance with our config data $pusher = new \Pusher\Pusher( config('broadcasting.connections.pusher.key'), config('broadcasting.connections.pusher.secret'), config('broadcasting.connections.pusher.app_id'), config('broadcasting.connections.pusher.options') );

// Your data that you would like to send to Pusher
$data = ['text' => 'hello world from Laravel 5.3'];

$pusher->trigger(['private-testChannel'], 'client-method', $data); // not working
$pusher->get_channel_info('private-testChannel'); // does work normally

"

Bas-Korver commented 2 years ago

I have the same problem, downgrading to 7.0.2 for now worked for me.

sonologico commented 2 years ago

I haven't been able to reproduce this. 7.2.0 had a small fix related to paths. I wonder if you were relying on the behaviour before the bug fix. Are you passing a path in the options parameter?

kukumagi commented 2 years ago

I haven't been able to reproduce this. 7.2.0 had a small fix related to paths. I wonder if you were relying on the behaviour before the bug fix. Are you passing a path in the options parameter?

There was no path parameter in my old options so no. Then for now I will assume that I should check the documentation and go from there.

sonologico commented 2 years ago

Could you try 7.1.0-beta? The paths fix wasn't in that version. That would help determine if that is the issue or if there's something else at play.

benjamin-tang-pusher commented 2 years ago

There's a known issue with self-hosting laravel-websockets and our library: https://github.com/pusher/pusher-http-php/issues/351. Apparently it will need to be fixed on the laravel-websockets side. I will close this issue as we only support using our official clusters.