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

Remove dependency on unique nick names #72

Closed
blenderskool opened this issue Sep 21, 2020 · 7 comments
Closed

Remove dependency on unique nick names #72

blenderskool opened this issue Sep 21, 2020 · 7 comments
Labels
enhancement Enhancing an existing feature refactor Major refactoring of code needed

Comments

@blenderskool
Copy link
Owner

blenderskool commented Sep 21, 2020

The unique nicknames rule was originally added to prevent multiple sessions from the same browser window. It is used in some places to identify a peer in the room. This dependency on the unique nicknames should be removed and auto-generated unique id must be used.

Update
This description was not clear in terms of when peers would be allowed in the room or not. Here are the cases that can happen:

  • Should peers with the same nicknames be allowed in the same room?
    Yes, peers with the same nicknames would be allowed in the same room (assuming they have unique ids).
  • Can the same peer join the same room from a different tab?
    No, this shouldn't be allowed. This would cause two peers with the same id in the same room which isn't needed.
  • Can the same peer join two different rooms from different tabs?
    Yes, this should be possible.
@blenderskool blenderskool added the enhancement Enhancing an existing feature label Sep 21, 2020
@omnone
Copy link
Contributor

omnone commented Sep 30, 2020

Hey I am interested on this, can you provide some more information ? Thanks!

@blenderskool
Copy link
Owner Author

Hi @omnone,
A quick way to see the issue is by going to Blaze from two different tabs and join the same room. There will be a message stating User with the same name exists in this room. This is because Blaze expects the name of the user to be unique in a room.

The best place to start working on this issue is to:

  • go to socketConnect.js and check what data we are sending right now while joining a room. Maybe add an auto-generated id here.
  • check the WebSocket server in server/index.js and update it to use the above id instead of name in some places. Especially in room.broadcast method.
  • Update the frontend to make use of the above id too. Most of the code in the frontend uses name or peerId for identifying the peer right now, All of these need to be refactored accordingly.

All in all, this issue has a large impact area.

@blenderskool blenderskool added the refactor Major refactoring of code needed label Oct 1, 2020
@omnone
Copy link
Contributor

omnone commented Oct 1, 2020

Awesome i will give it a try thanks!

@blenderskool
Copy link
Owner Author

Sure @omnone 😄

@omnone
Copy link
Contributor

omnone commented Oct 1, 2020

Will users be still able to select their usernames or will uuids be used everywhere?

@blenderskool
Copy link
Owner Author

@omnone yes users will still be able to use nicknames. The flow does not change for a user in anyway. Only internally users would be identified by the unique id

@blenderskool
Copy link
Owner Author

Closing this. There's no need for this right now and I think it'll cause confusions to the user(seeing two-three peers with same nickname). We are adding a way to change nickname so that should also solve issues for people incorrectly setting same nicknames on all their devices.

@blenderskool blenderskool closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing an existing feature refactor Major refactoring of code needed
Projects
None yet
Development

No branches or pull requests

2 participants