SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Rust client SDK: Remove use of `?connection_id` query param to `subscribe` HTTP route

Open gefjon opened this issue 10 months ago • 1 comments

Currently, the SDK generates its ConnectionId locally, and passes it to the subscribe HTTP route. This is wrong; the server should (and would, given the opportunity) generate a unique ConnectionId for the connection and return it to the client. Rework the Rust client SDK to that effect.

DoD: When running the Rust client SDK tests, the host logs do not contain any lines like:

2025-02-19T15:53:04.862398Z DEBUG /home/phoebe/clockworklabs/SpacetimeDB/crates/client-api/src/routes/subscribe.rs:74: The connection_id query parameter to the subscribe HTTP endpoint is internal and will be removed in a future version of SpacetimeDB.    

gefjon avatar Feb 19 '25 15:02 gefjon

I think this is higher priority than the C# and TypeScript tickets since the Rust client SDK re-uses a single ConnectionId throughout the whole process, whereas the other two SDKs (I think) generate a fresh one for each new connection. So the Rust SDK is misbehaving in a user-facing way, whereas the other two are just using an internal API that we'd like to remove.

gefjon avatar Feb 19 '25 16:02 gefjon