laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
1.02k stars 71 forks source link

Fixed type error in connection message handler #144

Closed boris-glumpler closed 4 months ago

boris-glumpler commented 4 months ago

I installed and setup Reverb (Laravel 11, PHP 8.3) and have been getting the same type error from the beginning when running the server:

Laravel\Reverb\Protocols\Pusher\Http\Controllers\PusherController::Laravel\Reverb\Protocols\Pusher\Http\Controllers\{closure}(): Argument #1 ($message) must be of type string, Ratchet\RFC6455\Messaging\Message given, called in .../app/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php on line 254

Not sure why nobody else seems to be getting this error, but maybe something to do with strict typing as Ratchet\RFC6455\Messaging\Message is a stringable object. Anyways, just coercing $message to a string resolved the issue for me and I was getting successful pings after that.

All tests are still passing.