Update rust sdk to use v3 websocket api#4765
Open
joshua-spacetime wants to merge 1 commit intojoshua/ws/v3from
Open
Update rust sdk to use v3 websocket api#4765joshua-spacetime wants to merge 1 commit intojoshua/ws/v3from
joshua-spacetime wants to merge 1 commit intojoshua/ws/v3from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Adds Rust SDK support for the
v3.bsatn.spacetimedbWebSocket API which was added in #4761.v3is treated as a transport wrapper around existing v2 logical messages. On the Rust SDK side, that means:v3first and falls back tov2v3is negotiated, outbound client messages are batched into a single websocket frame up to256 KiBv3server frames are unwrapped back into ordered v2ServerMessagesv2behavior remains unchangedThe browser SDK path stays on
v2for now because the current wasm websocket wrapper does not expose the negotiated subprotocol, so safev3/v2fallback would require replacing that wrapper.API and ABI breaking changes
None. The Rust SDK public API is unchanged. Existing
v2servers continue to work via fallback, and the browser path remains onv2.Expected complexity level and risk
3
The surface area is small, but this changes transport negotiation, websocket framing, batching behavior, and inbound/outbound message handling in the native Rust SDK. The main risk is preserving correct
v2fallback and ordered handling while introducing capped v3 batching.Testing