-
Notifications
You must be signed in to change notification settings - Fork 13
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
Cable::Server#active_connections_for and Cable::Server#subscribed_channels_for public checkup methods #86
Cable::Server#active_connections_for and Cable::Server#subscribed_channels_for public checkup methods #86
Conversation
This PR is ready for review, but :
That being said, writing these methods and the corresponding specs made me fix a bug (calling So, I won't fight for these methods as new public api if it "stalls" this PR as the rest of the code changes suggestions is more valuable IMO :-) |
return true unless Connection::CHANNELS.has_key?(connection_identifier) | ||
if Connection::CHANNELS.has_key?(connection_identifier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't return before closing the connection socket in the case of a connection without channel subscriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's a bit of refactoring going on in here, but it all looks good from what I see 👍 I left a comment, but otherwise I think this is good.
Thanks for the review :-) |
🤦♂️ Ameba!!!! lol |
From #85, this is a draft proposal PR investigating the best way for the backend to check what connection / channel are active for a given token (ie user).
The maze of different
identifiers
must make me oblivious to a simpler (ie more efficient than a rough#select == token
) way to get the info we need.I've added some DRY suggestions.
Right now, this is a draft, it lacks proper specs.
I'm working to add them but if you have DX / code design remarks / etc. please tell, I'm really new to this codebase (and websockets in general) !