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

fix(socket.io-adapter): Add Sid to ExceptSids when client leaves default room #5266

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hoeeeeeh
Copy link

@hoeeeeeh hoeeeeeh commented Dec 20, 2024

If a client leaves the default room, it won't be excluded from a broadcast. Therefore, during the exclusion process, add it to exceptSids if an exceptRoom is included in sids.

The kind of change this PR introduces

  • Bug fix
  • New feature
  • Documentation update
  • Code change to improve performance
  • Other

Current Behavior

When a client leaves the default room, they are not added to exceptSids in the computeExceptSids function during the broadcast process. The sids in the default room should be added to exceptSids, but the default room gets deleted when the client leaves it.

New Behavior

If a room is not found in this.rooms, it checks whether the room exists in this.sids. If it does, the room is added to exceptSids. This ensures that the client is excluded from the broadcast if they are the sender, even when they are no longer in the default room.

Other Information (e.g., related issues)

Related issue: #4524

…exist

If a client leaves the default room, it won't be excluded in a broadcast. Therefore, during the exclusion process, if an exceptRoom is included in sids, add it to exceptSids.
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.

1 participant