# Description of Changes
This is a fix for community bug which auth token is not used to create
Websocket connection in Unity WebGL build.
The issue here:
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/issues/352
# API and ABI breaking changes
None
# Expected complexity level and risk
1
# Testing
- [ ] Using OAuth2.0 tokens, you should get the same `Identity` even
when the token is refreshed in the WebGL build
## Description of Changes
This is a fix for community bug
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/issues/340
that was the result of changes to SpacetimeDBClient code that missed
changes to the WebGL build.
## API
- [ ] This is an API breaking change to the SDK
## Requires SpacetimeDB PRs
- None
## Testsuite
SpacetimeDB branch name: master
## Testing
- [X] Tested changes against Blackholio running under a Unity WebGL
build
## Description of Changes
`NetworkRequestTracker` previously was keeping all historical reducer
request data, and searching through this every frame to get statistics.
I've modified it to throw out much more data -- it's much faster now,
but only updates every few seconds.
## API
Not an API break, but deprecates an argument of one of
NetworkRequestTracker's methods to no longer do anything.
Adds new APIs.
## Requires SpacetimeDB PRs
N/A
## Testsuite
SpacetimeDB branch name: master
## Testing
- [x] Tested Bitcraft. **Their F9 debug menu will require an update,
since we now only keep one time window of request data, rather than
being able to give information about multiple windows.** But it works.
- [x] Blackholio CI
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
## 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*
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [ ] Describe a test for this PR that you have completed
---------
Co-authored-by: Alessandro Asoni <alessandro@clockworklabs.io>
Co-authored-by: James Gilles <jameshgilles@gmail.com>
## Description of Changes
Recreating #311 using a branch in this repo in the hope of fixing the
Unity build.
## API
- [ ] This is an API breaking change to the SDK
## Requires SpacetimeDB PRs
## Testsuite
SpacetimeDB branch name: master
## Testing
- [x] blackholio
- [ ] bitcraft
---------
Co-authored-by: Guribo <guribovr@gmail.com>
## Description of Changes
Leverages https://github.com/clockworklabs/SpacetimeDB/pull/2725 to
speed up row deserialization. Also updates DLLs for recent upstream
fixes.
Changes:
- Uses much simpler code when deserializing enums, avoiding the use of
reflection
- Uses manually monomorphized row deserialization methods, which again
avoid the use of reflection when constructing row objects
## API
- [ ] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/2725
## Testsuite
SpacetimeDB branch name: jgilles/perf/faster-allocation
## Testing
*Write instructions for a test that you performed for this PR*
- [x] Blackholio
- [x] Bitcraft (have done a basic test but no in-depth testing)
This purges the DbValue type, instead using row instances themselves as
primary key for rows without primary keys. In addition, it instantiates
only a single BinaryReader when reading updates for a table, rather than
instantiating a BinaryReader and performing an array copy per-row of the
table.
Addresses
https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1633
## API
- [ ] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
## Requires SpacetimeDB PRs
## Testsuite
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [ ] CI
---------
Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
This dramatically improves performance by avoiding the default
implementation of BrotliStream.ReadByte() inherited from Stream, which
allocates an array per byte read.
## API
- [ ] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
## Requires SpacetimeDB PRs
## Testsuite
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [ ] Describe a test for this PR that you have completed
## Description of Changes
As it stands today, Unity WebGL doesn't work. Partially the reason for
this is Multi-Threading, and the other reason is the use of
`ClientWebSocket`. In order to fix this (specifically in the case of
Unity), here's some changes that _can_ be made. Note that this is mostly
a suggestion and does come with a few flaws, though arguably it might
still be better than it not working at all? Up to you!
The Tl;Dr of how it works, is to:
- **MultiThreading Problem**: simply invoke the `Task.Run` functions on
main thread instead, and use a coroutine in place of where the two
simultaneous threads was expected.
- **ClientWebSocket**: Use a `.jslib` to create the WebSocket directly
within Javascript, and then have JS call the corresponding correct
functions.
DISCLAIMER: currently OnClose doesn't quite work correctly as
`__allocate` isn't invoked correctly.
## API
Not a breaking change to the API, should be internal implementation
details
## Requires SpacetimeDB PRs
None
## Testsuite
????
SpacetimeDB branch name: master
## Testing
Open the Blackholeio project, try building it for WebGL
- [X] Made a game using the feature:
https://daxode.itch.io/eat-to-the-deep
---------
Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: John Detter <no-reply@boppygames.gg>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: James Gilles <jameshgilles@gmail.com>
## Description of Changes
Addresses
https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1585
There was an issue with row deduplication when a TransactionUpdate of
the form:
```
+ k1: v1
- k1: v1
- k1: v1
+ k1: v2
```
appeared, where `k1` is the primary key of a row and `v1`, `v2` are the
full values of that row. The old manner of processing updates would see
this as a no-op. I've updated the logic to handle this case correctly,
at the cost of an extra equality comparison per row in an update.
(Actually it's slightly cheaper than this, it skips the equality
comparison if there is only row with a particular primary key in an
update. This may help speed up processing of large updates e.g. chunk
data in BitCraft.)
## API
- [ ] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
## Requires SpacetimeDB PRs
## Testsuite
SpacetimeDB branch name: master
## Testing
- [x] Added a failing test, then fixed it
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
- Fixes an issue that was reported in the discord where a user was
connecting 2 clients to the same SpacetimeDB module with the same
identity but different connection IDs.
## API
- This is not breaking.
## Requires SpacetimeDB PRs
None
## Testsuite
SpacetimeDB branch name: master
## Testing
- [x] Build blackholio as a player build and launch it twice. You can
play on both clients without seeing this warning in Player.log.
---------
Co-authored-by: John Detter <no-reply@boppygames.gg>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes
This PR fixes one issue and adds regression tests for it, plus another
issue. These regression tests are run on CI. You can also run them
locally -- run a local spacetime instance and then
`tools~/run-regression-tests.sh ../SpacetimeDB`).
### Issue 1: Unsubscribe is non-functional
See
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/issues/279.
This was a coding mistake made during the rush to 1.0. It was easily
fixed.
### Issue 2: Indexes not tracking deletes
This was recently discovered by the BitCraft team.
The problem was introduced in
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/commit/cefc727b7693fe97e3dd848fef2bb17bf20c8be6
which introduced `RemoteTableHandle<EventContext,
Row>.IndexBase<Column>`. This class stores a `Dictionary<Column,
List<Row>>` to allow fast filtering. It relies on `List<Row>.Remove` to
remove elements from a list when a row delete is received.
`List<Row>.Remove` relies on `Row.Equals` to determine when elements are
equal.
`Row.Equals` formerly was not implemented for `[SpacetimeDB.Type]`s or
for generated Row types. So, this didn't work.
Now it does: it was fixed by
https://github.com/clockworklabs/SpacetimeDB/pull/239 . So all this PR
does to address this issue is add a regression test.
## API
- [x] This is an API breaking change to the SDK
The interface IDbConnection was changed; however, this changed part of
the interface is `internal`, so this should be entirely invisible to
users.
## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/239 (merged)
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [x] Added a repro for both issues
- [x] Added the repro to CI
- [x] Fixed both issues
## Description of Changes
Add SubscribeMulti and UnsubscribeMulti from upstream.
Fix unsubscribe bug found by testing against Bitcraft: Calling
`UnsubscribeThen` with any (non-null) callback would result in an
exception incorrectly telling the user that `Unsubscribe` had been
called twice.
Multiplicity support is implemented with unit tests + manual testing of
quickstart-chat.
Also, rows in the client cache are now looked up by primary key if
available, which I suspect is going to be a large performance boost.
## API
- [x] 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*
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: jgilles/final-cs-codegen-changes
## Testing
*Write instructions for a test that you performed for this PR*
- [x] unit tests
- [ ] Working with Ryan to add a test suite.
- [x] blackholio
## Description of Changes
Switches to Bearer authentication, which is the more proper auth schema
to use with tokens.
## API
- [ ] This is an API breaking change to the SDK
## Requires SpacetimeDB PRs
- https://github.com/clockworklabs/SpacetimeDB/pull/2181
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: master
---------
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: rekhoff <r.ekhoff@clockworklabs.io>
Co-authored-by: James Gilles <jameshgilles@gmail.com>
## Description of Changes
We were not stripping `/` from the end of URIs provided to `Connect`. We
manually append `/...` to the provided addresses, so if we don't start
by stripping trailing `/`s, we end up with `//` in the URI and we get
errors.
Addresses part of
https://github.com/clockworklabs/SpacetimeDB/issues/1551.
## API
No breaking changes. This fixes an error case.
## Requires SpacetimeDB PRs
None
## Testsuite
SpacetimeDB branch name: master
## Testing
- [x] Tested the quickstart chat client with a host containing a
trailing `/`
```
# start a server, publish the module, send some input
# I also updated one line in `client.csproj` to use `Net8.0` because I no longer have `Net7.0` installed
$ cd examples~/quickstart/client
$ dotnet run
[I] SpacetimeDBClient: Connecting to ws://localhost:3000 quickstart-chat
C200098E is online
Connected
C2007471: hello
C2007471: godo
C2007471: asdf
$ sed -i 's/localhost:3000/localhost:3000\//' Program.cs
$ dotnet run
[I] SpacetimeDBClient: Connecting to ws://localhost:3000 quickstart-chat
C2000601 is online
Connected
C2007471: hello
C2007471: godo
C2007471: asdf
$ git diff
diff --git a/examples~/quickstart/client/Program.cs b/examples~/quickstart/client/Program.cs
index 9eb43b1..289e736 100644
--- a/examples~/quickstart/client/Program.cs
+++ b/examples~/quickstart/client/Program.cs
@@ -7,8 +7,8 @@ using System.Threading;
using SpacetimeDB;
using SpacetimeDB.Types;
-const string HOST = "http://localhost:3000";
-const string DBNAME = "chatqs";
+const string HOST = "http://localhost:3000/";
+const string DBNAME = "quickstart-chat";
// our local client SpacetimeDB identity
Identity? local_identity = null;
diff --git a/examples~/quickstart/client/client.csproj b/examples~/quickstart/client/client.csproj
index 48917cc..ab7ce44 100644
--- a/examples~/quickstart/client/client.csproj
+++ b/examples~/quickstart/client/client.csproj
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>net7.0</TargetFramework>
+ <TargetFramework>net8.0</TargetFramework>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
```
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes
as described
## API
no breaks
## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/2241
## Testsuite
SpacetimeDB branch name: jgilles/unknown_reducer
## Testing
see SpacetimeDB PR
## Description of Changes
Companion to [Rename `Address` to
`ConnectionId`](https://github.com/clockworklabs/SpacetimeDB/pull/2220).
See that PR's description for more.
Like all the SDKs, this PR does not change the SDK's behavior; the SDK
still generates a connection ID locally and passes it through the HTTP
API. This is not exposed to users, and can be changed in a follow-up.
Also, use `/usr/bin/env bash` instead of `/bin/bash` in tools, for
portability reasons.
## API
- [x] This is an API breaking change to the SDK
`Address` is renamed to `ConnectionId`.
## Requires SpacetimeDB PRs
- https://github.com/clockworklabs/SpacetimeDB/pull/2220
-
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: phoebe/rename-address-to-connection-id
## Testing
- [x] Pretty much just automated testing.
- [x] @kazimuth will need to update and run Blackholio.
---------
Co-authored-by: James Gilles <jameshgilles@gmail.com>
## Description of Changes
C# part of https://github.com/clockworklabs/SpacetimeDB/pull/1836
Needs to be rebased onto
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/pull/220
once that is merged.
## API
- [x] This is an API breaking change to the SDK
ScheduleAt is now constructed in slightly different ways.
## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: phoebe/timestamp-special-type
## Testing
Will need an update to blackholio as well.
## Description of Changes
Unfortunately, none of our tests currently cover this, but while working
on the V9 upgrade, I noticed that this code still relies on `type(Row)`
as a unique table identifier.
That no longer holds with multi-tables as several tables can share the
same `Row` type. In that case, subscription updates would be grouped
incorrectly and always applied to the same first table that uses `Row`
for its data storage.
This PR fixes that by using the table handle itself as a key (compared
by reference).
If transaction updates are already grouped uniquely by table, it should
be possible to simplify this code much further, but I'm not sure if such
guarantee exists, so leaving that untouched.
## 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*
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [x] I did `dotnet test`, but as mentioned in the description, this
requires adding tests for multi-table subscriptions, which I'm afraid I
won't have time to do, so have to leave to follow-up devs.
---------
Co-authored-by: james gilles <jameshgilles@gmail.com>
## Description of Changes
This is the companion PR for
https://github.com/clockworklabs/SpacetimeDB/pull/2184, please see the
other PR for full description.
On the client side main changes are:
- Regenerate .NET and Unity test client bindings and test snapshot.
- Remove `IDatabaseRow` since V9 multi-tables splits data types from
actual table definitions, so those "table data types" are no longer
special. Just using `IStructuralReadWrite` in its place now.
- Add base index classes as mentioned in the other PR.
- As a sub-improvement, the non-unique index class actually does
indexing instead of iterating over the entire table like we did before.
- Remove internal-but-not-really `InternalInvokeValueDeleted` and
`InternalInvokeValueInserted` methods in favour of private events.
## API
- [x] This is an API breaking change to the SDK
Removes some technically-visible but internal APIs.
## Requires SpacetimeDB PRs
https://github.com/clockworklabs/SpacetimeDB/pull/2184
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: ingvar/csharp-new-codegen
## Testing
*Write instructions for a test that you performed for this PR*
- [x] Manually tested Blackholio
---------
Co-authored-by: James Gilles <jameshgilles@gmail.com>
## 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
https://github.com/clockworklabs/SpacetimeDB/pull/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
Looks like client API bindings haven't been regenerated in a while, and
this is a necessary precursor to the new subscription work. This PR
fixes the generation script, regenerates the bindings and updates
affected code.
## 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*
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: v1.0.0-rc3
## Testing
*Write instructions for a test that you performed for this PR*
- [x] Ran regular `dotnet test`.
- [x] Checked Unity tests via CI.
## Description of Changes
Per out-of-band discussion, add
`SubscriptionBuilder.SubscribeToAllTables`, which abstracts over
`SubscriptionBuilder.Subscribe(["SELECT * FROM *"])`.
In the future, we will change the implementation of this method, so that
it uses "legacy subscriptions" while `SubscriptionBuilder.Subscribe`
moves to using "mutable subscriptions." At that time, no other interface
will be provided for using "legacy subscriptions."
`SubscribeToAllTables` may also at some point be rewritten in terms of
"mutable subscriptions" somehow.
## API
- [ ] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
## Requires SpacetimeDB PRs
N/a
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [x] @cloutiertyler will use this in the new tutorial and report back.
---------
Co-authored-by: Ingvar Stepanyan <ingvar@clockworklabs.io>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
## Description of Changes
`WithCredentials` was designed for our old auth model, where tokens were
always issued by the SpacetimeDB host alongside an `Identity`, and
therefore the bearer always knew their `Identity`.
In our new auth model, a client may have a valid auth-able JWT but not
know what `Identity` it will result in,
as the `Identity` is computed based on the hash of some of the token's
contents, and this hashing algorithm is not included in our client SDKs.
As such, this PR revises `WithCredentials` to `WithToken`, which just
accepts the token.
## API
- [x] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
`WithCredentials` is renamed and its signature changes.
## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [ ] @cloutiertyler should test this with the Unity tutorial, if
possible.
---------
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
## Description of Changes
This is a requested DX improvement to make sure that IDE shows
reasonable argument names instead of `arg0`...`argN`.
Fixes
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/issues/200.
## API
- [x] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
Potentially breaking in obscure edge cases, if someone already had
`Action<...> myCallback;` that they passed to those APIs as C# won't
cast it automatically to our custom delegate type.
## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
## Testsuite
*If you would like to run against a specific SpacetimeDB branch in the
testsuite, specify that here. This can be a branch name or a link to a
PR.*
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [x] `dotnet test`
Fixes#202.
Because SELECT * is ambiguous if the query is a join
## Description of Changes
Bug Fix
Previously `RemoteQuery` would implicitly `SELECT *`. This was wrong
because you can use `RemoteQuery` to issue join queries.
## 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*
## Testsuite
*If you would like to run the your SDK changes in this PR against a
specific SpacetimeDB branch, specify that here. This can be a branch
name or a link to a PR.*
SpacetimeDB branch name: v1.0.0-rc1
## Testing
*Write instructions for a test that you performed for this PR*
- [ ] Describe a test for this PR that you have completed
## Description of Changes
Counterpart to https://github.com/clockworklabs/SpacetimeDB/pull/2033.
Also updated test settings to make sure that sum type variants
implemented via subclassing are shown as expected.
## 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*
## Testsuite
*If you would like to run against a specific SpacetimeDB branch in the
testsuite, specify that here. This can be a branch name or a link to a
PR.*
SpacetimeDB branch name: master
## Testing
*Write instructions for a test that you performed for this PR*
- [ ] Describe a test for this PR that you have completed
## 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*
- https://github.com/clockworklabs/SpacetimeDB/pull/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

---------
Co-authored-by: John Detter <no-reply@boppygames.gg>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Co-authored-by: Jeremie Pelletier <jeremiep@gmail.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## 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 <no-reply@boppygames.gg>
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## 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 <steve@clockwokrlabs.io>
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
PR 155 introduced a build issue in Unity:

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 <no-reply@boppygames.gg>
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
## 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*
---------
Co-authored-by: John Detter <no-reply@boppygames.gg>
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
## 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*
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
## 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*
Co-authored-by: John Detter <no-reply@boppygames.gg>
This got broken when we switched to a new DbConnection API.
Keep track of all the active connections and update/destroy them from a
singleton game object. Fixes#134.
Marked as a draft for now, because it's untested and because we're not
yet sure that singleton for all connections as requested is the right
approach.
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
## 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*
---------
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: John Detter <no-reply@boppygames.gg>
## Description of Changes
Turns out, we're not ready for single Subscribe per query, so bringing
back this ability.
## 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*
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
## 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*
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
## 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*
## Description of Changes
*Describe what has been changed, any new features or bug fixes*
## API
- [x] 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*
## Description of Changes
Without explicit reference these result in
> error CS0119: 'UnityDebugLogger.Debug(string)' is a method, which is
not valid in the given context
## 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*