# Description of Changes
Closes: #3533
Updated the C# SDK to handle procedures and procedure callbacks in a
similar fashion to the Rust client as well as added the codegen to
support it.
# API and ABI breaking changes
N/A
# Expected complexity level and risk
2 - This adds a new testing frame that should be removed once procedures
are handled with C# module bindings
# Testing
Added /sdks/csharp/examples~/regression-tests/procedure-client to match
modules/sdk-test-procedure which we can roll into the standard
regression-tests once C# supports the procedure attribute.
- [x] Add C# client test of sdk-test-procedure
---------
Signed-off-by: Jason Larabie <jason@clockworklabs.io>
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>
## 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>
Adds an additional test of the `GenericEqualityComparer` function for
`Integer`, `String`, `Byte Array`, `Identity`, `User` and `TaggedEnum` type
comparisons.
This PR resolves additional checks as reported in by [Issue
230](https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/issues/230)
that where not-yet covered elsewhere.
## API
- [ ] This is an API breaking change to the SDK
## Requires SpacetimeDB PRs
No other PR are needed for this to work.
## Testsuite
SpacetimeDB branch name: master
## Testing
- [X] Locally ran `dotnet test` against the `tests.csproj` project and
it passed all tests
# Description of Changes
Update the C# server and client SDK quickstart-chat example to match the
code presented in the tutorial, as of
https://github.com/clockworklabs/spacetime-docs/pull/170 .
Also renamed the directory from `quickstart` to `quickstart-chat` in
order to be more specific.
# 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
1
## Requires SpacetimeDB PRs
SpacetimeDB branch name: master
com.clockworklabs.spacetimedbsdk: master
# Testing
*Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected!*
- [x] Ran `quickstart-chat` C# server and C# client locally and:
- Set my name.
- Sent a message.
- Restarted and viewed the message backlog.
- Sent a few more messages.
- Exited, deleted my local token, restarted and connected as a new
identity.
- Set my new identity's name.
- Sent a message as my new identity.
---------
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: John Detter <no-reply@boppygames.gg>
Co-authored-by: james gilles <jameshgilles@gmail.com>
## 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
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
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
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*
## 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
We have some flaky bug where Events are getting modified while we're
already iterating over them in the snapshot.
I think this might've been fixed by #144, but add extra checks just in
case so that the exception is thrown in a concrete event that causes it,
and not inside snapshot serialization.
## 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
Adds a utility script to generate `nuget.config` given a path to the
`SpacetimeDB` repo.
## API
No
## Requires SpacetimeDB PRs
None
## Testing
- [x] CI
- [x] Ran locally
---------
Co-authored-by: Zeke Foppa <bfops@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
Removing unstable APIs that are not used by BitCraft; marking others
with [Obsolete] and renaming few others to match the proposal.
One exception is InternalCallReducer - it would need some further
changes to codegen; marking it as Obsolete right now would cause all
generated clients to show noisy warnings.
## 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
Implements the subscription builder (at least, the parts that are
possible to implement).
## 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*
Changed logging based on [this
proposal](https://github.com/clockworklabs/SpacetimeDBPrivate/pull/981)
## API
- [x] This is an API breaking change to the SDK
*If the API is breaking, please state below what will break*
Logging interface is different now. `Logger` has been renamed to `Log`,
and its methods have been renamed as well (ex. `Logger.LogError` is now
`Log.Error`)
## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
---------
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Jeremie Pelletier <jeremiep@gmail.com>
Co-authored-by: Steve Boytsun <steve@clockwokrlabs.io>
Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
## Description of Changes
This creates a frankenstein monster of a repo that is compatible with
both .NET / MSBuild as well as can be consumed as a Unity package.
- `.meta` files, Unity manifests and Unity README were copied over from
the Unity repo.
- `examples` and `tests` folders were renamed to `examples~` and
`tests~` correspondingly, as the `~` suffix is the only way to get
entire folders ignored by Unity.
- MSBuild was configured to change `bin` and `obj` to `bin~` and `obj~`
for the same reasons. This doesn't matter for the Git repo, but helpful
for local development where you don't want Unity to try and load local
DLL artifacts.
- NuGet was configured to restore Unity-compatible NuGet DLLs (and
delete others) in a local folder and committed to the repo - so, from
now on, we can easily update them by modifying `.csproj` and via
standard `dotnet restore` / `dotnet build`.
After this change, this repo should be compatible with both .NET CLI
(e.g. `dotnet test`) as well as consumable from Unity, but due to amount
of metadata changes, it needs further testing before we merge repos
properly.
Fixes#114.
## 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: Zeke Foppa <bfops@users.noreply.github.com>