laravel / reverb

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

Wrong data format in the member_added and member_removed PresenceChannel events #125

Closed DemetrioMoscow closed 5 months ago

DemetrioMoscow commented 5 months ago

The Pusher protocol expects an encoded JSON string instead of an array

BadJacky commented 5 months ago

CleanShot 2024-03-30 at 17 49 00 CleanShot 2024-03-30 at 17 49 54

You can get details from the above images, and you should close this PR @DemetrioMoscow.

DemetrioMoscow commented 5 months ago

Yes, $message is a JSON. But the data inside the message should be a string with encoded JSON like: {"event":"pusher_internal:member_added","data":"{\"user_id\":\"1\",\"user_info\":1}","channel":"presence-channel"}

https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol/#example-json-3

taylorotwell commented 5 months ago

No tests.