-
Notifications
You must be signed in to change notification settings - Fork 177
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
Implement incremental subscriptions on the client #2111
Conversation
From out-of-band discussion: what happens if a client calls |
In both cases, |
I had forgotten that it returned a |
#2163 will also need to be merged in some form if we want to get the C# server module version of Blackholio working. Currently it's based at this branch but if we want to merge this first I can rebase it to master. |
## Description of Changes As proposed. No upstream codegen changes needed :) ## API - [x] This is an API breaking change to the SDK *If the API is breaking, please state below what will break* The subscription API is slightly different. ## Requires SpacetimeDB PRs clockworklabs/SpacetimeDB#2111 ## Testsuite SpacetimeDB branch name: jsdt/subscribe-sdk-3 ## Testing So far I have performed manual testing with the chat example. Working on updating the unity and unit tests. - [ ] Describe a test for this PR that you have completed
Description of Changes
This implements subscriptions to individual queries in the rust SDK.
Most of the logic is in
SubscriptionState
, which is the source of truth for the state of a subscription. Most of the complexity comes from the use of thePendingMutation
queue to delay operations, since some things can change by the time we call that callback.There are some important followup changes needed:
This also includes a server-side change to actually send SubscriptionError messages.
The corresponding private PR is https://github.com/clockworklabs/SpacetimeDBPrivate/pull/1279.
API and ABI breaking changes
If this is an API or ABI breaking change, please apply the
corresponding GitHub label.
Expected complexity level and risk
Testing
There are some basic tests in sdk/tests/test-client/src/main.rs that cover subscribing and unsubscribing to a query, and handling an error from subscribing to an invalid query.