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

Fatal error when empty channel name is sent on pusher:subscribe event #291

Closed
kirills-morozovs opened this issue Dec 27, 2024 · 1 comment

Comments

@kirills-morozovs
Copy link
Contributor

Reverb Version

1.4.4

Laravel Version

11.23.5

PHP Version

8.3.2

Description

When someone tries to open a new connection to empty channel it will crash the server with next message:

PHP Fatal error: Laravel\Reverb\Protocols\Pusher\Managers\ArrayChannelManager::find(): Return value must be of type ?Laravel\Reverb\Protocols\Pusher\Channels\Channel, array returned in /var/www/vendor/laravel/reverb/src/Protocols/Pusher/Managers/ArrayChannelManager.php:65
Stack trace:
#0 /var/www/vendor/laravel/reverb/src/Protocols/Pusher/Managers/ArrayChannelManager.php(73): find()
#1 /var/www/vendor/laravel/reverb/src/Protocols/Pusher/EventHandler.php(60): findOrCreate()
#2 /var/www/vendor/laravel/reverb/src/Protocols/Pusher/EventHandler.php(29): subscribe(object, , , NULL)
#3 /var/www/vendor/laravel/reverb/src/Protocols/Pusher/Server.php(56): handle(object, pusher:subscribe, array, NULL)
#4 /var/www/vendor/laravel/reverb/src/Protocols/Pusher/Http/Controllers/PusherController.php(34): message(object, {"event":"pusher:subscribe","data":{"auth":"","channel":""}})
#5 /var/www/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php(248): Laravel\Reverb\Protocols\Pusher\Http\Controllers\{closure}(object, object)
#6 /var/www/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php(194): processData(����2���Wn��F:��Bm��Wj��Gz��@q���4صSl���cذGl���:��{��\v���"��Oe)
#7 /var/www/vendor/evenement/evenement/src/EventEmitterTrait.php(143): onData(����2���Wn��F:��Bm��Wj��Gz��@q���4صSl���cذGl���:��{��\v���"��Oe)
#8 /var/www/vendor/react/stream/src/Util.php(71): emit(data, array)
#9 /var/www/vendor/evenement/evenement/src/EventEmitterTrait.php(143): React\Stream\{closure}(����2���Wn��F:��Bm��Wj��Gz��@q���4صSl���cذGl���:��{��\v���"��Oe)

Steps To Reproduce

Can be reproduced by sending {"event":"pusher:subscribe","data":{"auth":"","channel":""}} on reverb, while using pusher as broadcast driver

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

2 participants