You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to migrate from Pusher to Laravel Reverb with Laravel Echo and encountered some inconsistent behavior.
In Pusher, the member_added event is triggered whenever a user joins a channel. However, if the same user has multiple tabs open, this event triggers only for the first tab. Likewise, the member_removed event only triggers once a user has closed all their connections. See the Pusher documentation where this behavior is documented.
In Reverb, however, these events seem to trigger each time a user connects or disconnects to a presence channel. This makes it impossible to keep track of who is present. For example, if user A has one tab open, and user B two tabs, and user B closes one of the two tabs, user A receives a message that user B left. When user A refreshes the page, they do see that user B is present again.
Is this change of behavior intentional? If so, what would be the right way of keeping track of users with multiple tabs?
Steps To Reproduce
Echo.join(nameOfPresenceChannel).here((users)=>{console.log(users);}).joining((user)=>{console.log(user.name+' has joined');}).leaving((user)=>{console.log(user.name+' has left');})
Open one tab as user A and open the console log
Open two tabs as user B. User A will see that user B has joined.
Close one tab as user B. User A will see that user B has left (even though user B still has a tab open)
Refresh the tab with user A. User A will see that user B is actually still there.
The text was updated successfully, but these errors were encountered:
On the Pusher side, the message contains a array of unique user IDs. On the Reverb side, the same user ID can appear multiple times if that user has multiple connections open.
Reverb Version
1.0.0-beta13
Laravel Version
11.8.0
PHP Version
8.2.18
Description
We are trying to migrate from Pusher to Laravel Reverb with Laravel Echo and encountered some inconsistent behavior.
In Pusher, the
member_added
event is triggered whenever a user joins a channel. However, if the same user has multiple tabs open, this event triggers only for the first tab. Likewise, themember_removed
event only triggers once a user has closed all their connections. See the Pusher documentation where this behavior is documented.In Reverb, however, these events seem to trigger each time a user connects or disconnects to a presence channel. This makes it impossible to keep track of who is present. For example, if user A has one tab open, and user B two tabs, and user B closes one of the two tabs, user A receives a message that user B left. When user A refreshes the page, they do see that user B is present again.
Is this change of behavior intentional? If so, what would be the right way of keeping track of users with multiple tabs?
Steps To Reproduce
The text was updated successfully, but these errors were encountered: