RedisRoster not calling on_signed_in event, and not removing offline users - #1
Open
mmlin wants to merge 1 commit into
Open
RedisRoster not calling on_signed_in event, and not removing offline users#1mmlin wants to merge 1 commit into
mmlin wants to merge 1 commit into
Conversation
…o remove user from set 'juggernaut-roster:online-users'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello mitsuhiko. These are just a couple small fixes for the
RedisRosterimplementation. No API changes.I hope this helps. Great job by the way. It was really fun playing with this, and it's great to be able to use socket.io so easily with my Python apps.
on_signed_in()was never being calledIn
on_subcribe(), we check add a new session for the user. Afterwards, we check to see if that session was the first for thatuser_id. If so, we callon_signed_in(). The problem is that we whether the set is empty immediately after adding an entry--so it will never be.We should really be checking whether there's exactly one entry, which indicates this was the first session added for that user.
The user wasn't being removed from set
juggernaut-roster:online-usersThis looks like a typo. Instead of removing the user from the set, we are attempting to add him instead.