Skip to content

Batch websocket responses using the v3 protocol#5061

Merged
joshua-spacetime merged 3 commits into
masterfrom
joshua/batch-server-side-sends
May 20, 2026
Merged

Batch websocket responses using the v3 protocol#5061
joshua-spacetime merged 3 commits into
masterfrom
joshua/batch-server-side-sends

Conversation

@joshua-spacetime
Copy link
Copy Markdown
Contributor

@joshua-spacetime joshua-spacetime commented May 17, 2026

Description of Changes

In keeping with the "pipeline everything" approach of SpacetimeDB, this patch serializes multiple client updates in a single websocket message using the v3 protocol.

API and ABI breaking changes

None. spacetime subscribe was updated to use the v3 websocket api, but it falls back to v1 if protocol negotiation fails.

Expected complexity level and risk

2

Testing

This patch updates spacetime subscribe to use the v3 websocket protocol by default in order to get adequate coverage via the smoketests.

@joshua-spacetime joshua-spacetime force-pushed the joshua/message-pipelining branch from c5c3d1a to 0972b81 Compare May 18, 2026 04:30
@joshua-spacetime joshua-spacetime force-pushed the joshua/batch-server-side-sends branch from 31e54ca to fa60dfa Compare May 18, 2026 04:32
@joshua-spacetime joshua-spacetime force-pushed the joshua/message-pipelining branch from 0972b81 to 2926736 Compare May 18, 2026 18:23
@joshua-spacetime joshua-spacetime force-pushed the joshua/batch-server-side-sends branch from fa60dfa to 7f11e8b Compare May 18, 2026 18:24
Base automatically changed from joshua/message-pipelining to master May 18, 2026 22:46
@joshua-spacetime joshua-spacetime force-pushed the joshua/batch-server-side-sends branch 2 times, most recently from d6cc30a to abcec19 Compare May 19, 2026 00:54
@joshua-spacetime joshua-spacetime marked this pull request as ready for review May 19, 2026 00:56
Comment thread crates/core/src/worker_metrics/mod.rs
@joshua-spacetime joshua-spacetime requested a review from gefjon May 19, 2026 01:12
@joshua-spacetime joshua-spacetime force-pushed the joshua/batch-server-side-sends branch from d318465 to af242c1 Compare May 19, 2026 01:15
Accumulate up to 512KiB in single v3 message
Fallback to v1 on protocol negotiation
@joshua-spacetime joshua-spacetime force-pushed the joshua/batch-server-side-sends branch from 8d8a1f0 to 8eb0f19 Compare May 19, 2026 22:19
Copy link
Copy Markdown
Collaborator

@bfops bfops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My code-owned changes LGTM (in that they're mostly Spacetime-meat code that I don't have any strong opinions about).

I would like to have at least a manual test of the old-server-compatibility flow.

@joshua-spacetime
Copy link
Copy Markdown
Contributor Author

@gefjon feel free to ignore the spacetime subscribe changes if you'd like.

Comment thread crates/client-api/src/routes/subscribe.rs Outdated
@gefjon
Copy link
Copy Markdown
Contributor

gefjon commented May 20, 2026

I did, indeed, ignore the spacetime subscribe CLI changes.

@joshua-spacetime joshua-spacetime added this pull request to the merge queue May 20, 2026
Merged via the queue into master with commit f39360b May 20, 2026
51 of 52 checks passed
@joshua-spacetime joshua-spacetime deleted the joshua/batch-server-side-sends branch May 20, 2026 22:27
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

Successfully merging this pull request may close these issues.

3 participants