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

[1.x] Fixes incorrect user_count on presence channels #129

Merged
merged 4 commits into from
Apr 4, 2024
Merged

[1.x] Fixes incorrect user_count on presence channels #129

merged 4 commits into from
Apr 4, 2024

Conversation

ArthurPatriot
Copy link
Contributor

@ArthurPatriot ArthurPatriot commented Apr 4, 2024

1. user_count on get channels request

$pusher->getChannels(['filter_by_prefix' => 'presence-', 'info' => 'user_count']); return wrong number for user_count.

If we check Pusher documentation we will see - user_count is number of distinct users currently subscribed to this channel (a single user may be subscribed many times, but will only count as one). So user_count must return only unique users count, not connections count.

2. users list on get presence users request

$pusher->getPresenceUsers('presence-channel-id'); return wrong list of users with duplicates for each connection. If we check Pusher documentation - fetch user IDs of user currently subscribed to a presence channel. Here must be only unique users, not connections.

Resolves #130

@ArthurPatriot ArthurPatriot changed the title FIX: wrong calculation user_count on presence channels [1.x] [fix] Wrong calculation user_count on presence channels Apr 4, 2024
@taylorotwell taylorotwell requested a review from joedixon April 4, 2024 17:34
Copy link
Collaborator

@joedixon joedixon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joedixon joedixon changed the title [1.x] [fix] Wrong calculation user_count on presence channels [1.x] Fixes incorrect user_count on presence channels Apr 4, 2024
@taylorotwell taylorotwell merged commit 5cd1453 into laravel:main Apr 4, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

Wrong calculation user_count on presence channels
3 participants