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

Restore room client IDs #39

Open
harveysanders opened this issue Feb 21, 2023 · 2 comments · May be fixed by #40
Open

Restore room client IDs #39

harveysanders opened this issue Feb 21, 2023 · 2 comments · May be fixed by #40
Assignees

Comments

@harveysanders
Copy link
Contributor

harveysanders commented Feb 21, 2023

Previously, the server generated an ID for each client when they joined a room. This was done by sending back a CONNECT message on room join.
https://github.com/Rapidmidiex/rmx/pull/28/files#diff-0225d3aae6312632c69937171e2ac0767228028ca0ffac566ec39847ab020ea6R79-R105
The message looked something like this

{
  "id": "36aaa399-fa47-44d4-bab4-23c73bf71551",
  "type": "CONNECT",
  "userId": "5b34ee27-4ad9-48f8-9fd5-f7e445f55d76",
  "payload": {
    "userId": "5b34ee27-4ad9-48f8-9fd5-f7e445f55d76",
    "userName": "DJ Black Pearl"
  }
}

We've since removed that logic, as it was just a placeholder until we added something more robust.

@adoublef
Copy link
Contributor

So I think the handling of user_ids will still be handled by the server but via separate REST endpoint.

Given instantiating the Websocket is on top of a GET can't really send a payload so don't think we can do it within our jamService.handleP2P handler.

I think instead we should use a separate endpoint to deal with creating and getting users usernames, and then before establishing a connection, make a authorized get request to make sure this user with username is allowed.

Then after the connection is established can send that detail via the messages payload with a sender field.

@harveysanders
Copy link
Contributor Author

Yeah, I think that makes sense. Can you link your diagram?

Sidenote: not to say we should go with WS over REST, but we can send messages via websocket after the connection is
established. It wouldn't be through a GET body anyway

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 a pull request may close this issue.

2 participants