clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.35k stars 109 forks source link

If you connect to SpacetimeDB with an invalid token in Unity it says "Connection error Unable to connect to remote server". This should be changed to tell you your token is bad. #1397

Open cloutiertyler opened 3 months ago

cloutiertyler commented 3 months ago

zeke investigation results so far

cloutiertyler commented 1 month ago

The error response message from SpacetimeDB needs to differentiate between connecting to a module that doesn't exist and a bad token. We do not currently do this. This is an API break.

cloutiertyler commented 2 weeks ago

We just need to update this so that clients receive an error message that their token is invalid.

bfops commented 2 weeks ago

It's worth saying that we're planning to rework identities & tokens pretty soon - maybe we should revisit this after that refactoring happens?

cloutiertyler commented 4 days ago

I'll just note, that in a meeting with @jdetter we decided that the identities and tokens rework is not going to make this issue go away although hopefully it will make it less frequent.

gefjon commented 2 days ago

Empirical analysis shows this to be the SDK's problem, not the host's. The host sends a reasonable HTTP error response with a well-chosen status code and a human-readable description in the body in response to /database/subscribe calls with invalid tokens, and the Rust SDK is able to print these. (Currently it prints the status code but not the body, but it clearly receives the intended response.) Somewhere in the C# SDK, whether it's our code or the WebSocket library we use, the client is discarding that HTTP error response and printing something stupid and useless instead.

cloutiertyler commented 2 days ago

We have determined that this is an issue in the C# SDK or C# websocket client specifically. It is correct in the API. Thus I'm moving this to 1.0.