Skip to content

TypeScript SDK: Remove use of ?connection_id query param to subscribe HTTP route #142

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

Open
gefjon opened this issue Feb 19, 2025 · 1 comment

Comments

@gefjon
Copy link
Contributor

gefjon commented Feb 19, 2025

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 TypeScript client SDK to that effect.

DoD: When running a TypeScript client, 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.    
@manchuwook
Copy link

manchuwook commented May 15, 2025

Example chat server code for typescript doesn't work when you set the spacetimedb port to something other than 3000 (13000 in my case because I already have stuff that runs by default on 3000). Gives a 404 and the client can't connect.

spacetimedb-standalone version: 1.1.1

spacetimedb-standalone path: /opt/spacetime/spacetimedb-standalone

database running in data directory /home/spacetime/.local/share/spacetime/data

warning: some trace filter directives would enable traces that are disabled statically

note: `spacetimedb=debug` would enable the DEBUG level for the `spacetimedb` target

note: `spacetimedb_client_api=debug` would enable the DEBUG level for the `spacetimedb_client_api` target

note: `spacetimedb_lib=debug` would enable the DEBUG level for the `spacetimedb_lib` target

note: `spacetimedb_standalone=debug` would enable the DEBUG level for the `spacetimedb_standalone` target

note: `spacetimedb_commitlog=info` would enable the INFO level for the `spacetimedb_commitlog` target

note: `spacetimedb_durability=info` would enable the INFO level for the `spacetimedb_durability` target

note: `axum::rejection=trace` would enable the TRACE level for the `axum::rejection` target

note: the static max level is `off`

help: to enable logging, remove the `max_level_off` feature from the `tracing` crate

2025-05-15T02:35:53.546292Z DEBUG /usr/src/app/crates/standalone/src/subcommands/start.rs:148: Starting SpacetimeDB listening on 0.0.0.0:13000    

2025-05-15T02:38:06.307293Z DEBUG /usr/src/app/crates/client-api/src/routes/subscribe.rs:78: The connection_id query parameter to the subscribe HTTP endpoint is internal and will be removed in a future version of SpacetimeDB.    

2025-05-15T02:38:06.325594Z DEBUG /usr/src/app/crates/client-api/src/routes/subscribe.rs:78: The connection_id query parameter to the subscribe HTTP endpoint is internal and will be removed in a future version of SpacetimeDB.    

2025-05-15T02:42:40.904901Z DEBUG /usr/src/app/crates/client-api/src/routes/subscribe.rs:78: The connection_id query parameter to the subscribe HTTP endpoint is internal and will be removed in a future version of SpacetimeDB.    

2025-05-15T02:42:40.930455Z DEBUG /usr/src/app/crates/client-api/src/routes/subscribe.rs:78: The connection_id query parameter to the subscribe HTTP endpoint is internal and will be removed in a future version of SpacetimeDB.    

2025-05-15T02:43:07.972909Z DEBUG /usr/src/app/crates/client-api/src/routes/subscribe.rs:78: The connection_id query parameter to the subscribe HTTP endpoint is internal and will be removed in a future version of SpacetimeDB.  

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

No branches or pull requests

2 participants