Duplicate session rejection feedback to client
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
When a user connects a second time, the router rejects it:
```
if self.users.contains_key(&tenant_user_id) {
let _ = respond_to.send(Err("User already online".to_string()));
return;
}
```
But in session.rs, this error propagates up to ConnectionManager::handle_connection, which just logs it. The WebSocket is already upgraded at that point so the client gets a connection that immediately dies with no explanation. Sending a Message::Close with a reason code/message before dropping the socket would let the client show "You're already connected in another tab."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in session.rs at ConnectionManager::handle_connection and trace the duplicate-user error from the router rejection. Check how the upgraded WebSocket is dropped and how Message::Close is represented; done means the client receives a close reason explaining that the user is already connected in another tab.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100