Implement server-side support for the v2 websocket protocol#4213
Merged
Implement server-side support for the v2 websocket protocol#4213
Conversation
Incl. mention of future possibility of PK-ful partial updates.
Resolve merge conflicts and fix compilation errors: - Recreate message_handlers_v1.rs and message_handlers_v2.rs (v1/v2 dispatch) - Adapt for Option<ReducerName> change from master - Convert TableName to Box<str> for TableUpdate::new calls - Fix async closure annotations in call_view_add_v2_subscription - Fix BTreeMap key type (TableName doesn't impl Ord)
27e5d09 to
9437a55
Compare
Both types wrap Identifier which already implements Ord. Revert the Box<str> workaround in module_subscription_manager.
RowListLen is defined in websocket::common but was not re-exported from websocket::v1. Import it directly from common instead.
Centril
requested changes
Feb 12, 2026
This reverts commit 1bdea5c.
Centril
reviewed
Feb 12, 2026
Centril
reviewed
Feb 12, 2026
Centril
approved these changes
Feb 12, 2026
Contributor
Centril
left a comment
There was a problem hiding this comment.
I'm concerned about the amount of duplication that could turn into high-interest technical debt if we don't fuse the code and v1 stays on for more than a few months. I do think we should fuse the code, but not in this PR, which now looks good from a semantic and performance standpoint.
This is good to merge :)
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
This adds the v2 websocket protocol and adds support on the server side. For context on many of the changes/decisions, you can look at the discussion on #4023.
To restate some of the key changes:
ReducerResultwhich includes the outcome of the reducer call and and related row updates for queries that the client is subscribed to.Notes for reviewers:
crates/client-api-messages/src/websocket(intocommon,v1, andv2), and this renaming of existing messages adds a lot of noise to the PR.module_subscription_manager.rshas probably has the biggest changes, since we now track queries by query_set_id, and we get to remove some complexity of v1's FormatSwitch.API and ABI breaking changes
The v1 protocol still works, though we won't send the reducer event info for v10 modules.
Expected complexity level and risk
Testing
Unit testing is pretty minimal for the new code paths. I've done some manual e2e testing with the typescript quickstart, and this has been tested with a different branch implementing the v2 rust client.