laravel / reverb

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

[1.x] Correctly dispatches presence events #216

Closed joedixon closed 2 weeks ago

joedixon commented 2 weeks ago

This PR resolves #213

The fixes introduced all occur when a user is logged in to a single account, but connected to Reverb in multiple tabs or browswers.

The subscription_succeeded event should contain a unique list of connected user IDs.

The member_added event should only be dispatched the first time a user connects to the channel (e.g. the first browser tab).

The member_removed event should only be dispatched when the user no longer has any connections remaining (e.g. closed all tabs).

Details can be found in the Pusher spec.

stefanvdlugt commented 2 weeks ago

@joedixon I can confirm that this PR resolves issue #213. Thanks!