feat: generate WebSocket token from auth#354
Conversation
…i-updates Some API updates
…i-updates2 More API updates
…w updates and reducer events
…Improvements API callback improvements
…ption 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 <no-reply@clockworklabs.io> Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com> Co-authored-by: John Detter <no-reply@boppygames.gg>
* 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 <no-reply@boppygames.gg>
* Serialize byte arrays as hex * Fix namespace * Small fix --------- Co-authored-by: John Detter <no-reply@boppygames.gg>
* 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 <no-reply@boppygames.gg>
Co-authored-by: John <no-reply@boppygames.gg>
Co-authored-by: John Detter <no-reply@boppygames.gg>
…ckworklabs#15) Co-authored-by: John Detter <no-reply@boppygames.gg>
* Several updates to the way ClientCache + processing updates works * Client cache changes working * Removed log statements --------- Co-authored-by: John Detter <no-reply@boppygames.gg>
* Copied changes from BitCraft * Applied state diff changes * State diffs complete * Compilation fix * Fix build issues --------- Co-authored-by: John Detter <no-reply@boppygames.gg>
* 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 <no-reply@boppygames.gg>
* 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 <no-reply@boppygames.gg>
* Adding event parameter to table callbacks * Reverted a namespace change --------- Co-authored-by: Steve <steve@codefics.com> Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Derek Brinkmann <dbrinkmann@citadelstudios.net>
* Add onSubscriptionUpdate callback * Remove unnecesary onTransactionComplete --------- Co-authored-by: Derek Brinkmann <dbrinkmann@citadelstudios.net>
…ed from callbacks (clockworklabs#20) Co-authored-by: Steve <steve@codefics.com>
* 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 <steve@codefics.com> Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com> Co-authored-by: John Detter <no-reply@boppygames.gg>
Co-authored-by: Steve <steve@codefics.com>
Co-authored-by: John Detter <no-reply@boppygames.gg>
* 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 <steve@codefics.com> Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
* 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 <steve@codefics.com> Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
## Description of Changes Just bumping version numbers in preparation for an upcoming release. I also relaxed the version constraints in the `.csproj` files to be flexible in their patch versions. ## API - [ ] This is an API breaking change to the SDK No breaking changes. ## Requires SpacetimeDB PRs None ## Testsuite SpacetimeDB branch name: master ## Testing Just existing CI, since this just bumps version numbers. Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes Instead of our CI failing and telling the user that a PR should be based on `master`, we automatically change the base branch to `master`. ## API No code changes. ## Requires SpacetimeDB PRs None ## Testsuite SpacetimeDB branch name: master ## Testing - [x] See below, where the new CI changed the base branch of this PR! - [x] On this test PR, the base branch was not changed: clockworklabs#299 --------- Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## 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 Just bumping the DLLs for a version number update. No actual changes. ## API No breaking changes ## Requires SpacetimeDB PRs ## Testsuite SpacetimeDB branch name: master ## Testing Just existing CI. This only bumps versions. --------- Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes Bumping the version since 1.1.1 has been released. ## API No breaking changes ## Requires SpacetimeDB PRs None ## Testsuite SpacetimeDB branch name: master ## Testing None, just a version bump. Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes SDK side of clockworklabs/SpacetimeDB#2636 Addresses clockworklabs#281 ## API - [ ] This is an API breaking change to the SDK ## Requires SpacetimeDB PRs clockworklabs/SpacetimeDB#2636 ## 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/on-unhandled-reducer-error ## Testing - [ ] Add a test that this works to the regression-tests example module
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 *Describe what has been changed, any new features or bug fixes* - Bumps version to 1.1.3 ## API This is not an API breaking change - [ ] 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* - None ## 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* This is just a version bump, CI is sufficient.
## Description of Changes *Describe what has been changed, any new features or bug fixes* - Bumps version to 1.1.4 ## API Not breaking - [ ] 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* This is just a version bump
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>
Update DLLs and generated code for SpacetimeDB 74ad4a1
## Description of Changes Leverages clockworklabs/SpacetimeDB#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 clockworklabs/SpacetimeDB#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)
## Description of Changes Recreating clockworklabs#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 Just bumping version numbers in preparation for a release. The Unity SDK and C# SDK had different version numbers. That seems confusing, so I bumped them both to 1.1.5. ## API No breaking changes ## Requires SpacetimeDB PRs None, afaik ## Testsuite SpacetimeDB branch name: master ## Testing None Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes Update DLLs to the 1.1.2 versions that have been pushed to NuGet. The SpacetimeDB tag that they were built from is `v1.1.2-csharp-release`. ## API - [ ] This is an API breaking change to the SDK *If the API is breaking, please state below what will break* ## Requires SpacetimeDB PRs None, because we're updating the DLLs to essentially include SpacetimeDB PRs. ## Testsuite SpacetimeDB branch name: master ## Testing CI I guess? Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes Bump versions to 1.2.0, as well as update the DLLs from SpacetimeDB (commit `fc8f7dcc8`). They don't have any changes, but the versions needed bumping. ## API This itself is not a breaking changes. ## Requires SpacetimeDB PRs clockworklabs/SpacetimeDB#2837 ## Testsuite SpacetimeDB branch name: release/v1.2.0 ## Testing CI only --------- 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* ## 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 `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 Addresses https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1786 and clockworklabs#329. Marks messages as parsed from the background parsing thread, and then marks them as applied using a separate tracker once they are applied. ## 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] Testing against Bitcraft
## Description of Changes Updates the DLLs for clockworklabs/SpacetimeDB#2762, and bumps our version numbers as well. ## API - [ ] This is an API breaking change to the SDK Not a breaking change ## Requires SpacetimeDB PRs None afaik ## Testsuite SpacetimeDB branch name: master ## Testing *Write instructions for a test that you performed for this PR* - [x] Ran through Bitcraft tutorial - [x] Blackholio on CI --------- Co-authored-by: James Gilles <jameshgilles@gmail.com> Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes These version bumps were supposed to happen in clockworklabs#332, but apparently I messed something up while I was switching branches. ## API - [ ] This is an API breaking change to the SDK No breaking changes ## Requires SpacetimeDB PRs None. ## Testsuite SpacetimeDB branch name: master ## Testing CI only Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes Missed in clockworklabs#333. We should update the 1.2.1 tag and the `release/latest` branch after this. ## API - [ ] This is an API breaking change to the SDK Nope ## Requires SpacetimeDB PRs None ## Testsuite SpacetimeDB branch name: master ## Testing CI only Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes I'm tired of messing up version updates. I "vibecoded" a script to do it. ## API - [ ] This is an API breaking change to the SDK No. No changes to runtime code. ## Requires SpacetimeDB PRs None ## Testsuite SpacetimeDB branch name: master ## Testing ``` $ python3 tools~/update-version.py 1.1.1 Updated: ./SpacetimeDB.ClientSDK.csproj Updated: ./tests~/tests.csproj Updated: ./examples~/regression-tests/server/StdbModule.csproj Updated: ./examples~/regression-tests/client/client.csproj Updated: ./examples~/quickstart-chat/server/StdbModule.csproj Updated: ./examples~/quickstart-chat/client/client.csproj Updated version in package.json to 1.1.1 $ git diff -U1 diff --git a/SpacetimeDB.ClientSDK.csproj b/SpacetimeDB.ClientSDK.csproj index 5248df6..b3ca7e8 100644 --- a/SpacetimeDB.ClientSDK.csproj +++ b/SpacetimeDB.ClientSDK.csproj @@ -18,4 +18,4 @@ <RepositoryUrl>https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk</RepositoryUrl> - <AssemblyVersion>1.2.1</AssemblyVersion> - <Version>1.2.1</Version> + <AssemblyVersion>1.1.1</AssemblyVersion> + <Version>1.1.1</Version> <DefaultItemExcludes>$(DefaultItemExcludes);*~/**</DefaultItemExcludes> @@ -27,3 +27,3 @@ <ItemGroup> - <PackageReference Include="SpacetimeDB.BSATN.Runtime" Version="1.2.*" /> + <PackageReference Include="SpacetimeDB.BSATN.Runtime" Version="1.1.*" /> diff --git a/examples~/quickstart-chat/server/StdbModule.csproj b/examples~/quickstart-chat/server/StdbModule.csproj index 0513a81..f290d22 100644 --- a/examples~/quickstart-chat/server/StdbModule.csproj +++ b/examples~/quickstart-chat/server/StdbModule.csproj @@ -16,3 +16,3 @@ <ItemGroup> - <PackageReference Include="SpacetimeDB.Runtime" Version="1.2.*" /> + <PackageReference Include="SpacetimeDB.Runtime" Version="1.1.*" /> </ItemGroup> diff --git a/examples~/regression-tests/server/StdbModule.csproj b/examples~/regression-tests/server/StdbModule.csproj index c6b1cba..3284863 100644 --- a/examples~/regression-tests/server/StdbModule.csproj +++ b/examples~/regression-tests/server/StdbModule.csproj @@ -10,3 +10,3 @@ <ItemGroup> - <PackageReference Include="SpacetimeDB.Runtime" Version="1.2.*" /> + <PackageReference Include="SpacetimeDB.Runtime" Version="1.1.*" /> </ItemGroup> diff --git a/package.json b/package.json index 7839151..a627246 100644 --- a/package.json +++ b/package.json @@ -3,3 +3,3 @@ "displayName": "SpacetimeDB SDK", - "version": "1.2.1", + "version": "1.1.1", "description": "The SpacetimeDB Client SDK is a software development kit (SDK) designed to interact with and manipulate SpacetimeDB modules..", ``` --------- Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes This is a fix for community bug clockworklabs#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
jdetter
left a comment
There was a problem hiding this comment.
Thank you for the contribution! Small bit of feedback on this but I think this is the correct approach. Also, recently we've made our public SpacetimeDB repository our monorepo which means that the C#/UnitySDK lives here now: https://github.com/clockworklabs/SpacetimeDB/tree/master/sdks/csharp.
Would you mind opening up a PR with these changes against the SpacetimeDB repository instead? Thanks! Feel free to assign me for review when the PR is opened.
| manager.callbacks.error = errorCallback; | ||
| }, | ||
|
|
||
| WebSocket_Generate_Token: function(baseUriPtr, uriPtr, authTokenPtr, callbackPtr) { |
There was a problem hiding this comment.
Instead of having this be a separate function I would just do this by default in the connection setup logic. If the user passes an authentication token we should create the short-lived auth token automatically and then pass that as a query parameter instead of exposing a separate function.
|
I'm going to close this since it was migrated to clockworklabs/SpacetimeDB#2988. |
Description of Changes
This is a fix for community bug #352
This idea was inspired by the Typescript SDK
API
If the API is breaking, please state below what will break
Requires SpacetimeDB PRs
None
Testsuite
SpacetimeDB branch name: master
Testing