Allow duplicate usernames #16

Closed
opened 2023-06-23 17:14:04 +00:00 by kirsle · 1 comment

When using JWT authentication: if a user logs in to the chat twice (in different tabs or on different devices), the chat server currently doesn't allow the duplicate username and will rename the second login to add a 2 at the end of their username.

The chat backend currently has assumptions that usernames should be unique (such as a hash map of usernames to their connection objects) that could be fixed.

Some possible complicating factors:

  • Webcam sharing and WebRTC peer connections
    • What if your first login was on cam and had viewers, and your connection drops out?
    • Currently you'd log in as a "2" user, and could open your cam there separately from your first account.
    • Or: what if you were active on 2 devices (desktop + mobile) and wanted to turn on your cam from both devices?
  • Message sync
    • Incoming chat messages would just go to all the devices you're actively logged in on
    • If you logged in to a second device later, it would only get new messages from then on but not the older messages from your first device
When using JWT authentication: if a user logs in to the chat twice (in different tabs or on different devices), the chat server currently doesn't allow the duplicate username and will rename the second login to add a 2 at the end of their username. The chat backend currently has assumptions that usernames should be unique (such as a hash map of usernames to their connection objects) that could be fixed. Some possible complicating factors: * Webcam sharing and WebRTC peer connections * What if your first login was on cam and had viewers, and your connection drops out? * Currently you'd log in as a "2" user, and could open your cam there separately from your first account. * Or: what if you were active on 2 devices (desktop + mobile) and wanted to turn on your cam from both devices? * Message sync * Incoming chat messages would just go to all the devices you're actively logged in on * If you logged in to a second device later, it would only get new messages from then on but not the older messages from your first device
kirsle added the
enhancement
label 2023-06-23 17:14:04 +00:00
Poster
Owner

This was handled a different way.

When JWT authentication is used to log in, you will take your username and your older sessions are disconnected and told that they have signed in somewhere else. Non-JWT logins will be assigned new usernames as before to reduce conflicts.

A more pressing/common issue was peoples network would hiccup and they log in again with a duplicate name and the chat server didn't realize the old name went away.

This was handled a different way. When JWT authentication is used to log in, you will _take_ your username and your older sessions are disconnected and told that they have signed in somewhere else. Non-JWT logins will be assigned new usernames as before to reduce conflicts. A more pressing/common issue was peoples network would hiccup and they log in again with a duplicate name and the chat server didn't realize the old name went away.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: apps/BareRTC#16
There is no content yet.