-
Notifications
You must be signed in to change notification settings - Fork 658
Websockets not working with pusher-php-server 7.2 #1041
Comments
I also lowered version for stable work laravel-websockets) |
Workaround
|
Holy shit. Thanks @szabrzyski ! I've been struggling with this for 1½ weeks now and couldn't figure out why my client side didn't catch the event. |
Когда планируется обновления? На 7.2 много чего который хотели бы пробовать. |
I have traced the issue to this: https://github.com/pusher/pusher-http-php/pull/329/files#r993378977 TLDR, the new payload for when dispatching to one channel is |
Also experiencing this issue. A bug report has been filed also at pusher/pusher-http-php#351 @luceos Strange, actually beyondcode/laravel-websockets does accept both channel and channels:
Have you actually tested a patch that solves the issue? |
I don't know then @madpilot78; truth be told I have a fork because I needed a custom implementation for a @flarum extension. And in this fork it now works. Diffing the last version with the new one, and testing things locally, only the channel change has been the most apparent one. The code you mentioned, which correctly adds the ability to read |
No you're probably right, I'm going to test again.
Oh, sorry, my bad I did not check when it was added. Then I'll test using code with that addition, maybe forcing using the repo head. |
Two days that will never come back 😓 Thanks guys, at least you saved my nerves 🫡 |
thanks @madpilot78 for fixing this, we're currently struggling with this issue on production. Any timeline on when this will be merged and tagged? |
Thank you so much! I've been stuck on this issue for days. You are my hero. I consider you from now on one of my closest friends. We're practically family now. |
@mpociot since we got this package merge in is there any chance we could make a release for this? |
2 days of my life wasted... Thank god I found this page before the weekend. Thanks to Bvanhaastrecht |
me too 👍 |
in laravel 9.37 with laravel-websockets 1.13.1 the solutions was downgrading to pusher-php-server 7.0.2 or use the latest pusher-php-server 7.2.1 and manually patch the TriggerEventController from here fe78daf |
@bci24 a better fix would be to use |
Spent 4 hours debugging the same issue, 4 hours i won't get back. thanks @mankms |
Spent the whole day editing configs and changing the composer file to figure out that V7.2 is broken is the source of the problem medilies/messenger-clone@6f60c31...a5223dd Now the question is. Should we expect an update soon? |
Higher not supported atm: beyondcode/laravel-websockets#1041
I've downgrade the pusher-php-server and still the client doesn't catch the events abd in the dashboard they didn't appear too |
I've ended up switching to soketi |
Looking forward to this issue being resolved. Downgrade pusher-php-server to 7.0.2 working for me. |
I spent a day, but downgrade to 7.0.2 helped me |
Unfortunately i've only found this issue after i've already resolved it by myself. Downgrading to 7.0.2 is the only thing that has worked for me. |
I had the same issue guys been debugging until this afternoon to find this thread, has anyone created a pull request to fix this or should I create one? |
A best way to fix:
<?php
namespace BeyondCode\LaravelWebSockets\HttpApi\Controllers;
use BeyondCode\LaravelWebSockets\Dashboard\DashboardLogger;
use BeyondCode\LaravelWebSockets\Facades\StatisticsLogger;
use Illuminate\Http\Request;
class TriggerEventController extends Controller
{
public function __invoke(Request $request)
{
$this->ensureValidSignature($request);
$channels = $request->json()->get('channels', []);
$channel = $request->json()->get('channel');
if ($channel) {
$channels[] = $channel;
}
foreach ($channels as $channelName) {
$channel = $this->channelManager->find($request->appId, $channelName);
optional($channel)->broadcastToEveryoneExcept([
'channel' => $channelName,
'event' => $request->json()->get('name'),
'data' => $request->json()->get('data'),
], $request->json()->get('socket_id'));
DashboardLogger::apiMessage(
$request->appId,
$channelName,
$request->json()->get('name'),
$request->json()->get('data')
);
StatisticsLogger::apiMessage($request->appId);
}
return (object) [];
}
} |
@kluevandrew You suggested patch looks very similar to mine from #1046, which has already been merged to the 1.x branch. Unluckily until a new release is cut from 1.x the change is not going to be distributed automatically. Let's hope a new 1.x release is cut soon. |
I still had the issue with v7.2.1 |
The issue is in beyondcode/laravel-websockets.
|
I don't understand why the fix is merged but not a new release being tagged. Is this repo even maintained? @mpociot |
This worked for me. Glad to find a solution after spending more than a day troubleshooting! |
You saved my 3 days |
"php": "^8.0", |
|
I have create full documentation for laravel websocket with realted issue every time. Please check it https://myphpinformation.blogspot.com/2024/01/laravel-websocket-setup-and-example-how-to-use-it.html this my help you. |
Hello, after pusher-php-server has been updated to version 7.2 websockets stopped working. I'm using Laravel Echo and the initial connection to private channel is successful, but then I'm not getting any events broadcasted on that channel. With pusher-php-server 7.0.2 everything works fine. Is the new version incompatible with Laravel Websockets and should I wait for an update?
The text was updated successfully, but these errors were encountered: