iiitl / iiitl/PerOXO

Duplicate session rejection feedback to client

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug easy
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.