Skip to content

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 23, 2024

Description of Changes

Companion to clockworklabs/SpacetimeDB#1883.

Requires SpacetimeDB PRs

Testsuite

SpacetimeDB branch name: centril/websocket-use-ids

jdetter and others added 30 commits November 2, 2022 12:01
Add sslEnabled option to Connect function
* Fix compilation issue with master

* Initial push for SATS (still WIP)

* Small build fix

* Small update

* Updates from meeting with Tyler

* Fixed issues with LayoutExplicit and added some missing functions

* AlgebraicValue cleanup

* Copied changes from BitCraftMini

* Removed TypeDef

---------

Co-authored-by: Clockwork Labs <[email protected]>
Co-authored-by: Tyler Cloutier <[email protected]>
Co-authored-by: John Detter <[email protected]>
* Upload script to help deploying to our partners

* You have to specify hosts individually

* Small fix

* Another small fix - tested + working

---------

Co-authored-by: John Detter <[email protected]>
* Serialize byte arrays as hex

* Fix namespace

* Small fix

---------

Co-authored-by: John Detter <[email protected]>
* First pass

* Committing meta file

* Removed option type - unneeded

* Implementing new some converter

* Some converter updates

* Tons of fixes here

* Cleaned up the some/enum serialization implementation

---------

Co-authored-by: John Detter <[email protected]>
* Several updates to the way ClientCache + processing updates works

* Client cache changes working

* Removed log statements

---------

Co-authored-by: John Detter <[email protected]>
* Copied changes from BitCraft

* Applied state diff changes

* State diffs complete

* Compilation fix

* Fix build issues

---------

Co-authored-by: John Detter <[email protected]>
* Pulled SpacetimeUnitySDK from the BitCraft project

* Removed unused logs

* Removed primary key functionality

* Fix compilation issues with older version of C#

* Primary key client implementation

* Another row update fix

---------

Co-authored-by: John <[email protected]>
* Pulled SpacetimeUnitySDK from the BitCraft project

* Removed unused logs

* Removed primary key functionality

* Fix compilation issues with older version of C#

---------

Co-authored-by: John <[email protected]>
* Adding event parameter to table callbacks

* Reverted a namespace change

---------

Co-authored-by: Steve <[email protected]>
Co-authored-by: John Detter <[email protected]>
Co-authored-by: Derek Brinkmann <[email protected]>
* Add onSubscriptionUpdate callback

* Remove unnecesary onTransactionComplete

---------

Co-authored-by: Derek Brinkmann <[email protected]>
* Deserializing reducer args before table updates so they can be accessed from callbacks

* Reducer arguments in table events

* Removed redundant onSubscriptionUpdate

---------

Co-authored-by: Steve <[email protected]>
Co-authored-by: John Detter <[email protected]>
Co-authored-by: John Detter <[email protected]>
Co-authored-by: Steve <[email protected]>
Co-authored-by: John Detter <[email protected]>
* Deserializing reducer args before table updates so they can be accessed from callbacks

* Reducer arguments in table events

* Adding OnBeforeDelete event to tables

* Renaming ReducerCallInfo to ReducerEvent

* Removed extra onSubscriptionUpdate

---------

Co-authored-by: Steve <[email protected]>
Co-authored-by: John Detter <[email protected]>
* Deserializing reducer args before table updates so they can be accessed from callbacks

* Reducer arguments in table events

* Adding OnBeforeDelete event to tables

---------

Co-authored-by: Steve <[email protected]>
Co-authored-by: John Detter <[email protected]>
Centril and others added 2 commits October 15, 2024 19:47
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

PR 155 introduced a build issue in Unity:


![image](https://github.com/user-attachments/assets/7e88a813-93bd-4b74-ad87-a4c821a7fb98)

This PR reverts back to a known working commit. I have tested after
reverting the commit and the branch is back to working properly.

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

Not breaking

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testing
*Write instructions for a test that you performed for this PR*

- [x] Tested circle game against this commit and it builds + works

Co-authored-by: John Detter <[email protected]>
@Centril Centril changed the base branch from master to staging October 23, 2024 07:58
@Centril Centril changed the base branch from staging to centril/websocket-light October 23, 2024 07:58
@Centril
Copy link
Contributor Author

Centril commented Oct 23, 2024

This will need two .meta files generated, cc @jdetter

## Description of Changes
Update the SpacetimeDB C# DLLs to be up to date with `master` in
SpacetimeDB (now that C# bindings have been bumped to `v1.0.0-rc1`).

We will need a followup PR

## API

Not a breaking change.

## Requires SpacetimeDB PRs
`master`

## Testing
Only automated tests

---------

Co-authored-by: Zeke Foppa <[email protected]>
@Centril Centril force-pushed the centril/websocket-light branch from 1e81268 to b83cc54 Compare October 30, 2024 12:20
@Centril Centril force-pushed the centril/websocket-ids-no-names branch from 53b3aa7 to da4dbc2 Compare October 30, 2024 12:22
@Centril Centril changed the title Companion to SpacetimeDB#1883 Companion to SpacetimeDB#1883 (ids-no-names) Oct 30, 2024
@Centril Centril force-pushed the centril/websocket-light branch from b83cc54 to b538f7c Compare October 30, 2024 13:27
@Centril Centril force-pushed the centril/websocket-ids-no-names branch from da4dbc2 to d83d981 Compare October 30, 2024 13:28
…ues (#182)

## Description of Changes
*Describe what has been changed, any new features or bug fixes*

Context:
https://discord.com/channels/568217153853980682/669989878955638785/1301132060878049332
Currently, when we receive subscription updates, a table will only be
diffed if subscription has any rows for that table. If, however, there
are no subscribed values, that table will NOT be diffed, and therefore
will not get cleared. Values from previous subscription will still be
there, so the table is in incorrect state.

This PR fixes that by making sure that ALL tables are checked in state
diff

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*


## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

## Testing
*Write instructions for a test that you performed for this PR*

- [ ] Create a table A with an `val: i32` field
- [ ] Generate rows for table A with field values in the range (0..100)
- [ ] Connect client and subscribe to `SELECT * FROM A WHERE val > 0`
(will have all rows from table A)
- [ ] Change your subscription to `SELECT * FROM A WHERE val > 1000`
(should have no rows)
- [ ] Note that after subscription is applied, table A will have no
values

Co-authored-by: Steve Boytsun <[email protected]>
@lcodes lcodes force-pushed the centril/websocket-light branch from b538f7c to 8a65659 Compare October 30, 2024 20:40
jdetter and others added 2 commits October 30, 2024 18:08
## Description of Changes
This PR edits the handling of errors related to websocket connections
and disconnections. In particular, clients and users would often run
into the dreaded `Connection Error: Success` message which was confusing
and frustrating. This PR better addresses the error by providing more
guidance and debug info for the user. It is unfortunately still
suboptimal because the `HttpStatusCode` is not available in the .NET
core version that Unity supports. We try to be as helpful as possible in
this scenario.

## API

- [x] This is an API breaking change to the SDK, because it changes the
returned values from the `OnDisconnect` and `OnConnectError` callbacks
to implement the API specification:
https://github.com/clockworklabs/SpacetimeDBPrivate/pull/866/files#diff-be533cc04817c33605a68d717c6ec320c4449904266ee8e1096971e9e17e8d31R424

## Requires SpacetimeDB PRs
No changes to SpacetimeDB required.

## Testing

I, Tyler, have tested this and confirmed it to be working with
CircleGame. Here is a sample of the output in the case of `Connection
Error: Success`:

<img width="1324" alt="image"
src="https://github.com/user-attachments/assets/2b98c69f-07e2-4d0b-a61f-0ae4f84d62f6">

---------

Co-authored-by: John Detter <[email protected]>
Co-authored-by: Tyler Cloutier <[email protected]>
Co-authored-by: Zeke Foppa <[email protected]>
**Please do not rebase this PR**

## Description of Changes
*Describe what has been changed, any new features or bug fixes*

This is very similar to
#176
except it imports the circle game as a submodule instead of copying the
code over into this repo. This is the SpacetimeDBCircleGame PR that
we're dependent on right now:
clockworklabs/Blackholio#3

- This PR introduces a testsuite which runs in Unity. Right now it just
spawns in a circle, eats some food and verifies the decay logic is
working correctly. I've also written some reconnection tests but they
don't work because reconnections are currently broken. There are also
one-off tests but those don't work either because they also require
reconnections to be working.

Update: reconnections have been fixed via
#168.

I've used the built-in unity testsuite framework to achieve this, along
with the UnityCI tool from GameCI. The documentation for this docker
container can be found here:
https://game.ci/docs/github/getting-started/

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

Not breaking

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

None

## Testsuite

SpacetimeDB branch name: 0935b73

## Testing
*Write instructions for a test that you performed for this PR*

- [x] The testsuite is passing:
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/actions/runs/11604456943/job/32313229775

You can follow test instructions here to double check my work:
clockworklabs/Blackholio#3

## Follow-up Actions

- [ ] Rebase the reconnection logic PR onto this PR and re-enable the
reconnection tests

---------

Co-authored-by: John Detter <[email protected]>
@Centril Centril force-pushed the centril/websocket-light branch from 8a65659 to 3572fd3 Compare October 31, 2024 17:48
…2) (#174)

## Description of Changes

Companion to clockworklabs/SpacetimeDB#1802.

## Requires SpacetimeDB PRs

None

## Test suite

SpacetimeDB branch name: 0935b73

---------

Co-authored-by: Jeremie Pelletier <[email protected]>
Co-authored-by: Zeke Foppa <[email protected]>
@Centril Centril force-pushed the centril/websocket-light branch from 3572fd3 to befe0d1 Compare October 31, 2024 18:10
jdetter and others added 2 commits October 31, 2024 22:34
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

- switched our "already connected" logic to using a reference to a
`MonoBehaviour` instead of just a bool. `MonoBehaviour`s are typically
destroyed when a scene reload happens and in this case we'll want to
allow developers to spawn a new `SpacetimeDBNetworkManager` if the
previous one has been destroyed.

## API

This is *not* an API break.

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*

## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

- clockworklabs/SpacetimeDB#1869

## Testsuite

SpacetimeDB branch name: master

## Testing
*Write instructions for a test that you performed for this PR*

- [x] I have added in several new tests here, one of which is a
reconnection test. Also, the reason why we couldn't have more than 1
test before this is that it was required for reconnections to be working
in order to have multiple tests running in the testsuite. Now that we
have fixed reconnections I have enabled all of the tests.

Testsuite passes


![image](https://github.com/user-attachments/assets/09ef5835-f2c7-41f1-af6b-e612ac5e0497)

---------

Co-authored-by: John Detter <[email protected]>
Co-authored-by: Mazdak Farrokhzad <[email protected]>
Co-authored-by: Jeremie Pelletier <[email protected]>
Co-authored-by: Zeke Foppa <[email protected]>
## Description of Changes

Adds C# sdk support for
clockworklabs/SpacetimeDB#1812.

## Requires SpacetimeDB PRs

- clockworklabs/SpacetimeDB#1812

## Testsuite

SpacetimeDB branch name: centril/websocket-light

---------

Co-authored-by: Tyler Cloutier <[email protected]>
Co-authored-by: John Detter <[email protected]>
Base automatically changed from centril/websocket-light to staging November 4, 2024 16:46
An error occurred while trying to automatically change base from centril/websocket-light to staging November 4, 2024 16:46
lcodes and others added 3 commits November 4, 2024 19:17
## Description of Changes

Fix the quickstart client program, also removes the rust server program (it lives in the stdb main repo under modules/quickstart-chat)

## Testing

Second subscription resets the first one without the fix

## Testsuite

SpacetimeDB branch name: master
## Description of Changes
Just bump `package.json` to `1.0.0-rc1` instead of `1.0.0`.

## API
No breaking changes

## Requires SpacetimeDB PRs
None

## Testing

Co-authored-by: Zeke Foppa <[email protected]>
@Centril Centril force-pushed the centril/websocket-ids-no-names branch from d83d981 to 83b4908 Compare November 11, 2024 14:10
@bfops
Copy link
Collaborator

bfops commented Aug 7, 2025

I'm going to close this given that clockworklabs/SpacetimeDB#1940 is still unmerged, and because we're merging this repo into SpacetimeDB. Feel free to integrate these changes into that PR directly. This branch should be available in SpacetimeDB as csharp/centril/websocket-ids-no-names.

@bfops bfops closed this Aug 7, 2025
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.