From 9db895e922b900a6a9eff43bc2be912ab500a920 Mon Sep 17 00:00:00 2001 From: Lisandro Crespo Date: Wed, 10 Jun 2026 14:25:00 -0500 Subject: [PATCH 1/3] Minor cleanup --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed9d5a1ba52..8b834a74aca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -884,7 +884,8 @@ jobs: run: dotnet restore --configfile ../../../NuGet.Config blackholio.csproj - name: Build Godot project - run: godot --headless --verbose --path demo/Blackholio/client-godot --build-solutions --quit + working-directory: demo/Blackholio/client-godot + run: godot --headless --verbose --build-solutions --quit - name: Start SpacetimeDB run: | @@ -898,7 +899,8 @@ jobs: bash ./publish.sh - name: Run Godot tests - run: godot --headless --path demo/Blackholio/client-godot --scene res://tests/GodotPlayModeTests.tscn + working-directory: demo/Blackholio/client-godot + run: godot --headless --scene res://tests/GodotPlayModeTests.tscn csharp-testsuite: needs: [lints] From f50573fa6f6c52e89f4147709b8761136fd0c1be Mon Sep 17 00:00:00 2001 From: Lisandro Crespo Date: Thu, 11 Jun 2026 13:26:53 -0500 Subject: [PATCH 2/3] Minor C# cleanup --- crates/bindings-csharp/Runtime/Internal/Bounds.cs | 5 ++--- crates/bindings-csharp/Runtime/Internal/Module.cs | 2 +- .../bindings-csharp/Runtime/TransactionalContextState.cs | 8 ++++---- sdks/csharp/src/SpacetimeDBClient.cs | 6 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/crates/bindings-csharp/Runtime/Internal/Bounds.cs b/crates/bindings-csharp/Runtime/Internal/Bounds.cs index 2bdd42c3aa1..f3e302aa8de 100644 --- a/crates/bindings-csharp/Runtime/Internal/Bounds.cs +++ b/crates/bindings-csharp/Runtime/Internal/Bounds.cs @@ -1,6 +1,3 @@ -using System.IO; -using SpacetimeDB.BSATN; - namespace SpacetimeDB { public readonly struct Bound(T min, T max) @@ -16,6 +13,8 @@ public readonly struct Bound(T min, T max) namespace SpacetimeDB.Internal { + using SpacetimeDB.BSATN; + enum BoundVariant : byte { Inclusive, diff --git a/crates/bindings-csharp/Runtime/Internal/Module.cs b/crates/bindings-csharp/Runtime/Internal/Module.cs index cec7d980b98..45d17c58fae 100644 --- a/crates/bindings-csharp/Runtime/Internal/Module.cs +++ b/crates/bindings-csharp/Runtime/Internal/Module.cs @@ -567,7 +567,7 @@ BytesSink error } catch (Exception e) { - var error_str = e.Message ?? e.GetType().FullName; + var error_str = e.Message; var error_bytes = System.Text.Encoding.UTF8.GetBytes(error_str); error.Write(error_bytes); return Errno.HOST_CALL_FAILURE; diff --git a/crates/bindings-csharp/Runtime/TransactionalContextState.cs b/crates/bindings-csharp/Runtime/TransactionalContextState.cs index ef0d72de410..9fbdaebaa70 100644 --- a/crates/bindings-csharp/Runtime/TransactionalContextState.cs +++ b/crates/bindings-csharp/Runtime/TransactionalContextState.cs @@ -79,26 +79,26 @@ Func> body } } - private long StartMutTx() + private static long StartMutTx() { var status = FFI.procedure_start_mut_tx(out var micros); FFI.ErrnoHelpers.ThrowIfError(status); return micros; } - private void CommitMutTx() + private static void CommitMutTx() { var status = FFI.procedure_commit_mut_tx(); FFI.ErrnoHelpers.ThrowIfError(status); } - private void AbortMutTx() + private static void AbortMutTx() { var status = FFI.procedure_abort_mut_tx(); FFI.ErrnoHelpers.ThrowIfError(status); } - private bool CommitMutTxWithRetry(Func retryBody) + private static bool CommitMutTxWithRetry(Func retryBody) { try { diff --git a/sdks/csharp/src/SpacetimeDBClient.cs b/sdks/csharp/src/SpacetimeDBClient.cs index ef202ed168b..44d98c28096 100644 --- a/sdks/csharp/src/SpacetimeDBClient.cs +++ b/sdks/csharp/src/SpacetimeDBClient.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; @@ -133,6 +132,8 @@ public abstract class DbConnectionBase : IDbConne where DbConnection : DbConnectionBase, new() where Tables : RemoteTablesBase { + internal const bool IsTesting = false; + public static DbConnectionBuilder Builder() => new(); internal event Action? onConnect; @@ -280,8 +281,7 @@ internal struct ParsedMessage private readonly BlockingCollection _applyQueue = new(new ConcurrentQueue()); - - internal static bool IsTesting; + internal bool HasMessageToApply => _applyQueue.Count > 0; private readonly CancellationTokenSource _parseCancellationTokenSource = new(); From 467c0758b4ece789b7383ef18e0e75176a01f5ea Mon Sep 17 00:00:00 2001 From: Lisandro Crespo Date: Thu, 11 Jun 2026 13:38:09 -0500 Subject: [PATCH 3/3] Fix whitespace --- sdks/csharp/src/SpacetimeDBClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/csharp/src/SpacetimeDBClient.cs b/sdks/csharp/src/SpacetimeDBClient.cs index 44d98c28096..34645cd60b0 100644 --- a/sdks/csharp/src/SpacetimeDBClient.cs +++ b/sdks/csharp/src/SpacetimeDBClient.cs @@ -281,7 +281,7 @@ internal struct ParsedMessage private readonly BlockingCollection _applyQueue = new(new ConcurrentQueue()); - + internal bool HasMessageToApply => _applyQueue.Count > 0; private readonly CancellationTokenSource _parseCancellationTokenSource = new();