From 2dd2d3afb023be2e489fe8b254bcf0c9c2512681 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Wed, 23 Jul 2025 16:56:29 -0700 Subject: [PATCH 01/11] [bfops/check-bindings]: check bindings are --- .github/workflows/csharp-test.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/csharp-test.yml b/.github/workflows/csharp-test.yml index befeefe728c..345715332c5 100644 --- a/.github/workflows/csharp-test.yml +++ b/.github/workflows/csharp-test.yml @@ -76,6 +76,19 @@ jobs: # Share the target directory with our local project to avoid rebuilding same SpacetimeDB crates twice. CARGO_TARGET_DIR: demo/Blackholio/server-rust/target + - name: Check quickstart-chat bindings are up to date + working-directory: sdks/csharp/examples~/quickstart-chat + run: | + spacetime generate --lang csharp --out-dir client/module_bindings --project-path server + # This was copied from tools/check-diff.sh. + # It's required because `spacetime generate` creates lines with the SpacetimeDB commit + # version, which would make this `git diff` check very brittle if included. + PATTERN='^// This was generated using spacetimedb cli version.*' + git diff --exit-code --ignore-matching-lines="$PATTERN" -- . || { + echo "Error: Bindings have changed. Please generate bindings again and commit them to this branch." + exit 1 + } + - name: Generate client bindings working-directory: demo/Blackholio/server-rust run: bash ./generate.sh -y From 31b3f1897bca812b94465382dcfbb93e6c6fb9c3 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 12:30:43 -0700 Subject: [PATCH 02/11] [bfops/check-bindings]: REVERT THIS TEST COMMIT - update bindings --- ...ityDisconnected.g.cs => ClientConnected.g.cs} | 16 ++++++++-------- ...ityConnected.g.cs => ClientDisconnected.g.cs} | 16 ++++++++-------- .../module_bindings/Reducers/SendMessage.g.cs | 4 ++-- .../client/module_bindings/Reducers/SetName.g.cs | 4 ++-- .../module_bindings/SpacetimeDBClient.g.cs | 14 +++++++------- .../client/module_bindings/Tables/Message.g.cs | 2 +- .../client/module_bindings/Tables/User.g.cs | 2 +- .../client/module_bindings/Types/Message.g.cs | 8 ++++---- .../client/module_bindings/Types/User.g.cs | 8 ++++---- 9 files changed, 37 insertions(+), 37 deletions(-) rename sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/{IdentityDisconnected.g.cs => ClientConnected.g.cs} (64%) rename sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/{IdentityConnected.g.cs => ClientDisconnected.g.cs} (65%) diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs similarity index 64% rename from sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs rename to sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs index 2905db1a81d..43d9afca487 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -14,12 +14,12 @@ namespace SpacetimeDB.Types { public sealed partial class RemoteReducers : RemoteBase { - public delegate void IdentityDisconnectedHandler(ReducerEventContext ctx); - public event IdentityDisconnectedHandler? OnIdentityDisconnected; + public delegate void ClientConnectedHandler(ReducerEventContext ctx); + public event ClientConnectedHandler? OnClientConnected; - public bool InvokeIdentityDisconnected(ReducerEventContext ctx, Reducer.IdentityDisconnected args) + public bool InvokeClientConnected(ReducerEventContext ctx, Reducer.ClientConnected args) { - if (OnIdentityDisconnected == null) + if (OnClientConnected == null) { if (InternalOnUnhandledReducerError != null) { @@ -31,7 +31,7 @@ public bool InvokeIdentityDisconnected(ReducerEventContext ctx, Reducer.Identity } return false; } - OnIdentityDisconnected( + OnClientConnected( ctx ); return true; @@ -42,9 +42,9 @@ public abstract partial class Reducer { [SpacetimeDB.Type] [DataContract] - public sealed partial class IdentityDisconnected : Reducer, IReducerArgs + public sealed partial class ClientConnected : Reducer, IReducerArgs { - string IReducerArgs.ReducerName => "identity_disconnected"; + string IReducerArgs.ReducerName => "ClientConnected"; } } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs similarity index 65% rename from sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs rename to sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs index d4705866624..c3ea9002f3d 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -14,12 +14,12 @@ namespace SpacetimeDB.Types { public sealed partial class RemoteReducers : RemoteBase { - public delegate void IdentityConnectedHandler(ReducerEventContext ctx); - public event IdentityConnectedHandler? OnIdentityConnected; + public delegate void ClientDisconnectedHandler(ReducerEventContext ctx); + public event ClientDisconnectedHandler? OnClientDisconnected; - public bool InvokeIdentityConnected(ReducerEventContext ctx, Reducer.IdentityConnected args) + public bool InvokeClientDisconnected(ReducerEventContext ctx, Reducer.ClientDisconnected args) { - if (OnIdentityConnected == null) + if (OnClientDisconnected == null) { if (InternalOnUnhandledReducerError != null) { @@ -31,7 +31,7 @@ public bool InvokeIdentityConnected(ReducerEventContext ctx, Reducer.IdentityCon } return false; } - OnIdentityConnected( + OnClientDisconnected( ctx ); return true; @@ -42,9 +42,9 @@ public abstract partial class Reducer { [SpacetimeDB.Type] [DataContract] - public sealed partial class IdentityConnected : Reducer, IReducerArgs + public sealed partial class ClientDisconnected : Reducer, IReducerArgs { - string IReducerArgs.ReducerName => "identity_connected"; + string IReducerArgs.ReducerName => "ClientDisconnected"; } } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs index 551618458a8..3e2f341ff11 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -63,7 +63,7 @@ public SendMessage() this.Text = ""; } - string IReducerArgs.ReducerName => "send_message"; + string IReducerArgs.ReducerName => "SendMessage"; } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs index 9b6d7cfcc70..086ee9c0322 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -63,7 +63,7 @@ public SetName() this.Name = ""; } - string IReducerArgs.ReducerName => "set_name"; + string IReducerArgs.ReducerName => "SetName"; } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs index 359ca6ab6da..17d3387e164 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -468,10 +468,10 @@ protected override Reducer ToReducer(TransactionUpdate update) var encodedArgs = update.ReducerCall.Args; return update.ReducerCall.ReducerName switch { - "identity_connected" => BSATNHelpers.Decode(encodedArgs), - "identity_disconnected" => BSATNHelpers.Decode(encodedArgs), - "send_message" => BSATNHelpers.Decode(encodedArgs), - "set_name" => BSATNHelpers.Decode(encodedArgs), + "ClientConnected" => BSATNHelpers.Decode(encodedArgs), + "ClientDisconnected" => BSATNHelpers.Decode(encodedArgs), + "SendMessage" => BSATNHelpers.Decode(encodedArgs), + "SetName" => BSATNHelpers.Decode(encodedArgs), var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") }; } @@ -493,8 +493,8 @@ protected override bool Dispatch(IReducerEventContext context, Reducer reducer) var eventContext = (ReducerEventContext)context; return reducer switch { - Reducer.IdentityConnected args => Reducers.InvokeIdentityConnected(eventContext, args), - Reducer.IdentityDisconnected args => Reducers.InvokeIdentityDisconnected(eventContext, args), + Reducer.ClientConnected args => Reducers.InvokeClientConnected(eventContext, args), + Reducer.ClientDisconnected args => Reducers.InvokeClientDisconnected(eventContext, args), Reducer.SendMessage args => Reducers.InvokeSendMessage(eventContext, args), Reducer.SetName args => Reducers.InvokeSetName(eventContext, args), _ => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs index 73c30ae33e5..f9bff5ccc85 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs index 8c5945a237f..6a735ae9b38 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs index a386797d9b9..3daf7bf2067 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -15,11 +15,11 @@ namespace SpacetimeDB.Types [DataContract] public sealed partial class Message { - [DataMember(Name = "sender")] + [DataMember(Name = "Sender")] public SpacetimeDB.Identity Sender; - [DataMember(Name = "sent")] + [DataMember(Name = "Sent")] public SpacetimeDB.Timestamp Sent; - [DataMember(Name = "text")] + [DataMember(Name = "Text")] public string Text; public Message( diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs index 4dcf8eb52fb..ebb0a11c936 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -15,11 +15,11 @@ namespace SpacetimeDB.Types [DataContract] public sealed partial class User { - [DataMember(Name = "identity")] + [DataMember(Name = "Identity")] public SpacetimeDB.Identity Identity; - [DataMember(Name = "name")] + [DataMember(Name = "Name")] public string? Name; - [DataMember(Name = "online")] + [DataMember(Name = "Online")] public bool Online; public User( From 41b6df43669cd0be8ab7703676295745a16edc96 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 12:31:57 -0700 Subject: [PATCH 03/11] [bfops/check-bindings]: revert previous commit --- ...tDisconnected.g.cs => IdentityConnected.g.cs} | 16 ++++++++-------- ...tConnected.g.cs => IdentityDisconnected.g.cs} | 16 ++++++++-------- .../module_bindings/Reducers/SendMessage.g.cs | 4 ++-- .../client/module_bindings/Reducers/SetName.g.cs | 4 ++-- .../module_bindings/SpacetimeDBClient.g.cs | 14 +++++++------- .../client/module_bindings/Tables/Message.g.cs | 2 +- .../client/module_bindings/Tables/User.g.cs | 2 +- .../client/module_bindings/Types/Message.g.cs | 8 ++++---- .../client/module_bindings/Types/User.g.cs | 8 ++++---- 9 files changed, 37 insertions(+), 37 deletions(-) rename sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/{ClientDisconnected.g.cs => IdentityConnected.g.cs} (65%) rename sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/{ClientConnected.g.cs => IdentityDisconnected.g.cs} (64%) diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs similarity index 65% rename from sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs rename to sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs index c3ea9002f3d..d4705866624 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -14,12 +14,12 @@ namespace SpacetimeDB.Types { public sealed partial class RemoteReducers : RemoteBase { - public delegate void ClientDisconnectedHandler(ReducerEventContext ctx); - public event ClientDisconnectedHandler? OnClientDisconnected; + public delegate void IdentityConnectedHandler(ReducerEventContext ctx); + public event IdentityConnectedHandler? OnIdentityConnected; - public bool InvokeClientDisconnected(ReducerEventContext ctx, Reducer.ClientDisconnected args) + public bool InvokeIdentityConnected(ReducerEventContext ctx, Reducer.IdentityConnected args) { - if (OnClientDisconnected == null) + if (OnIdentityConnected == null) { if (InternalOnUnhandledReducerError != null) { @@ -31,7 +31,7 @@ public bool InvokeClientDisconnected(ReducerEventContext ctx, Reducer.ClientDisc } return false; } - OnClientDisconnected( + OnIdentityConnected( ctx ); return true; @@ -42,9 +42,9 @@ public abstract partial class Reducer { [SpacetimeDB.Type] [DataContract] - public sealed partial class ClientDisconnected : Reducer, IReducerArgs + public sealed partial class IdentityConnected : Reducer, IReducerArgs { - string IReducerArgs.ReducerName => "ClientDisconnected"; + string IReducerArgs.ReducerName => "identity_connected"; } } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs similarity index 64% rename from sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs rename to sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs index 43d9afca487..2905db1a81d 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -14,12 +14,12 @@ namespace SpacetimeDB.Types { public sealed partial class RemoteReducers : RemoteBase { - public delegate void ClientConnectedHandler(ReducerEventContext ctx); - public event ClientConnectedHandler? OnClientConnected; + public delegate void IdentityDisconnectedHandler(ReducerEventContext ctx); + public event IdentityDisconnectedHandler? OnIdentityDisconnected; - public bool InvokeClientConnected(ReducerEventContext ctx, Reducer.ClientConnected args) + public bool InvokeIdentityDisconnected(ReducerEventContext ctx, Reducer.IdentityDisconnected args) { - if (OnClientConnected == null) + if (OnIdentityDisconnected == null) { if (InternalOnUnhandledReducerError != null) { @@ -31,7 +31,7 @@ public bool InvokeClientConnected(ReducerEventContext ctx, Reducer.ClientConnect } return false; } - OnClientConnected( + OnIdentityDisconnected( ctx ); return true; @@ -42,9 +42,9 @@ public abstract partial class Reducer { [SpacetimeDB.Type] [DataContract] - public sealed partial class ClientConnected : Reducer, IReducerArgs + public sealed partial class IdentityDisconnected : Reducer, IReducerArgs { - string IReducerArgs.ReducerName => "ClientConnected"; + string IReducerArgs.ReducerName => "identity_disconnected"; } } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs index 3e2f341ff11..551618458a8 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -63,7 +63,7 @@ public SendMessage() this.Text = ""; } - string IReducerArgs.ReducerName => "SendMessage"; + string IReducerArgs.ReducerName => "send_message"; } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs index 086ee9c0322..9b6d7cfcc70 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -63,7 +63,7 @@ public SetName() this.Name = ""; } - string IReducerArgs.ReducerName => "SetName"; + string IReducerArgs.ReducerName => "set_name"; } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs index 17d3387e164..359ca6ab6da 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -468,10 +468,10 @@ protected override Reducer ToReducer(TransactionUpdate update) var encodedArgs = update.ReducerCall.Args; return update.ReducerCall.ReducerName switch { - "ClientConnected" => BSATNHelpers.Decode(encodedArgs), - "ClientDisconnected" => BSATNHelpers.Decode(encodedArgs), - "SendMessage" => BSATNHelpers.Decode(encodedArgs), - "SetName" => BSATNHelpers.Decode(encodedArgs), + "identity_connected" => BSATNHelpers.Decode(encodedArgs), + "identity_disconnected" => BSATNHelpers.Decode(encodedArgs), + "send_message" => BSATNHelpers.Decode(encodedArgs), + "set_name" => BSATNHelpers.Decode(encodedArgs), var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") }; } @@ -493,8 +493,8 @@ protected override bool Dispatch(IReducerEventContext context, Reducer reducer) var eventContext = (ReducerEventContext)context; return reducer switch { - Reducer.ClientConnected args => Reducers.InvokeClientConnected(eventContext, args), - Reducer.ClientDisconnected args => Reducers.InvokeClientDisconnected(eventContext, args), + Reducer.IdentityConnected args => Reducers.InvokeIdentityConnected(eventContext, args), + Reducer.IdentityDisconnected args => Reducers.InvokeIdentityDisconnected(eventContext, args), Reducer.SendMessage args => Reducers.InvokeSendMessage(eventContext, args), Reducer.SetName args => Reducers.InvokeSetName(eventContext, args), _ => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs index f9bff5ccc85..73c30ae33e5 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs index 6a735ae9b38..8c5945a237f 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs index 3daf7bf2067..a386797d9b9 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -15,11 +15,11 @@ namespace SpacetimeDB.Types [DataContract] public sealed partial class Message { - [DataMember(Name = "Sender")] + [DataMember(Name = "sender")] public SpacetimeDB.Identity Sender; - [DataMember(Name = "Sent")] + [DataMember(Name = "sent")] public SpacetimeDB.Timestamp Sent; - [DataMember(Name = "Text")] + [DataMember(Name = "text")] public string Text; public Message( diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs index ebb0a11c936..4dcf8eb52fb 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -15,11 +15,11 @@ namespace SpacetimeDB.Types [DataContract] public sealed partial class User { - [DataMember(Name = "Identity")] + [DataMember(Name = "identity")] public SpacetimeDB.Identity Identity; - [DataMember(Name = "Name")] + [DataMember(Name = "name")] public string? Name; - [DataMember(Name = "Online")] + [DataMember(Name = "online")] public bool Online; public User( From d1ebc333505ff25245c591c77ec82a1a079a3b65 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 12:47:39 -0700 Subject: [PATCH 04/11] [bfops/check-bindings]: update tests --- ...p_dumpName=LegacySubscribeAll.verified.txt | 402 +++------------- ...ump_dumpName=SubscribeApplied.verified.txt | 450 ++++-------------- 2 files changed, 150 insertions(+), 702 deletions(-) diff --git a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt index ad04d010a6e..cf5dc7f390e 100644 --- a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt +++ b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt @@ -1,4 +1,4 @@ -{ +{ Events: { Log: SpacetimeDBClient: Connecting to wss://spacetimedb.com example, OnConnect: { @@ -18,8 +18,8 @@ ConnectionId: Guid_1 }, user: { - identity: Identity_1, - online: true + Identity: Identity_1, + Online: true } }, OnInsertUser: { @@ -35,26 +35,14 @@ ConnectionId: Guid_1 }, user: { - identity: Identity_2, - online: true + Identity: Identity_2, + Online: true } }, OnInsertUser: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487763059031, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.IdentityConnected - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -64,27 +52,14 @@ ConnectionId: Guid_1 }, user: { - identity: Identity_3, - online: true + Identity: Identity_3, + Online: true } }, OnUpdateUser: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487768057579, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SetName, - name: A - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -94,61 +69,19 @@ ConnectionId: Guid_1 }, oldUser: { - identity: Identity_1, - online: true + Identity: Identity_1, + Online: true }, newUser: { - identity: Identity_1, - name: A, - online: true + Identity: Identity_1, + Name: A, + Online: true } }, - OnSetName: { - Event: { - Timestamp: 1718487768057579, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SetName, - name: A - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnInsertMessage: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487775346381, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Hello, A! - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -158,57 +91,15 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_3, - sent: 1718487775346381, - text: Hello, A! + Sender: Identity_3, + Sent: 1718487775346381, + Text: Hello, A! } }, - OnSendMessage: { - Event: { - Timestamp: 1718487775346381, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Hello, A! - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnUpdateUser: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487777307855, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SetName, - name: B - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -218,61 +109,19 @@ ConnectionId: Guid_1 }, oldUser: { - identity: Identity_3, - online: true + Identity: Identity_3, + Online: true }, newUser: { - identity: Identity_3, - name: B, - online: true + Identity: Identity_3, + Name: B, + Online: true } }, - OnSetName: { - Event: { - Timestamp: 1718487777307855, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SetName, - name: B - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnInsertMessage: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487783175083, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Hello, B! - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -282,57 +131,15 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_1, - sent: 1718487783175083, - text: Hello, B! + Sender: Identity_1, + Sent: 1718487783175083, + Text: Hello, B! } }, - OnSendMessage: { - Event: { - Timestamp: 1718487783175083, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Hello, B! - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnInsertMessage: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487787645364, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Goodbye! - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -342,56 +149,15 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_3, - sent: 1718487787645364, - text: Goodbye! + Sender: Identity_3, + Sent: 1718487787645364, + Text: Goodbye! } }, - OnSendMessage: { - Event: { - Timestamp: 1718487787645364, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Goodbye! - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnUpdateUser: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487791901504, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.IdentityDisconnected - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -401,33 +167,20 @@ ConnectionId: Guid_1 }, oldUser: { - identity: Identity_3, - name: B, - online: true + Identity: Identity_3, + Name: B, + Online: true }, newUser: { - identity: Identity_3, - name: B, - online: false + Identity: Identity_3, + Name: B, + Online: false } }, OnInsertMessage: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487794937841, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Goodbye! - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -437,78 +190,49 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_1, - sent: 1718487794937841, - text: Goodbye! + Sender: Identity_1, + Sent: 1718487794937841, + Text: Goodbye! } - }, - OnSendMessage: { - Event: { - Timestamp: 1718487794937841, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Goodbye! - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 } }, FinalSnapshot: { User: [ { - identity: Identity_1, - name: A, - online: true + Identity: Identity_1, + Name: A, + Online: true }, { - identity: Identity_2, - online: true + Identity: Identity_2, + Online: true }, { - identity: Identity_3, - name: B, - online: false + Identity: Identity_3, + Name: B, + Online: false } ], Message: [ { - sender: Identity_3, - sent: 1718487775346381, - text: Hello, A! + Sender: Identity_3, + Sent: 1718487775346381, + Text: Hello, A! }, { - sender: Identity_1, - sent: 1718487783175083, - text: Hello, B! + Sender: Identity_1, + Sent: 1718487783175083, + Text: Hello, B! }, { - sender: Identity_3, - sent: 1718487787645364, - text: Goodbye! + Sender: Identity_3, + Sent: 1718487787645364, + Text: Goodbye! }, { - sender: Identity_1, - sent: 1718487794937841, - text: Goodbye! + Sender: Identity_1, + Sent: 1718487794937841, + Text: Goodbye! } ] }, diff --git a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt index 9368d6d83a9..006237378b7 100644 --- a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt +++ b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt @@ -1,4 +1,4 @@ -{ +{ Events: { Log: SpacetimeDBClient: Connecting to wss://spacetimedb.com example, OnConnect: { @@ -18,8 +18,8 @@ ConnectionId: Guid_1 }, user: { - identity: Identity_1, - online: true + Identity: Identity_1, + Online: true } }, OnInsertUser: { @@ -35,26 +35,14 @@ ConnectionId: Guid_1 }, user: { - identity: Identity_2, - online: true + Identity: Identity_2, + Online: true } }, OnInsertUser: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487763059031, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.IdentityConnected - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -64,27 +52,14 @@ ConnectionId: Guid_1 }, user: { - identity: Identity_3, - online: true + Identity: Identity_3, + Online: true } }, OnUpdateUser: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487768057579, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SetName, - name: A - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -94,61 +69,19 @@ ConnectionId: Guid_1 }, oldUser: { - identity: Identity_1, - online: true + Identity: Identity_1, + Online: true }, newUser: { - identity: Identity_1, - name: A, - online: true + Identity: Identity_1, + Name: A, + Online: true } }, - OnSetName: { - Event: { - Timestamp: 1718487768057579, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SetName, - name: A - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnInsertMessage: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487775346381, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Hello, A! - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -158,57 +91,15 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_3, - sent: 1718487775346381, - text: Hello, A! + Sender: Identity_3, + Sent: 1718487775346381, + Text: Hello, A! } }, - OnSendMessage: { - Event: { - Timestamp: 1718487775346381, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Hello, A! - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnUpdateUser: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487777307855, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SetName, - name: B - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -218,61 +109,19 @@ ConnectionId: Guid_1 }, oldUser: { - identity: Identity_3, - online: true + Identity: Identity_3, + Online: true }, newUser: { - identity: Identity_3, - name: B, - online: true + Identity: Identity_3, + Name: B, + Online: true } }, - OnSetName: { - Event: { - Timestamp: 1718487777307855, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SetName, - name: B - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnInsertMessage: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487783175083, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Hello, B! - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -282,57 +131,15 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_1, - sent: 1718487783175083, - text: Hello, B! + Sender: Identity_1, + Sent: 1718487783175083, + Text: Hello, B! } }, - OnSendMessage: { - Event: { - Timestamp: 1718487783175083, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Hello, B! - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnInsertMessage: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487787645364, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Goodbye! - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -342,56 +149,15 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_3, - sent: 1718487787645364, - text: Goodbye! + Sender: Identity_3, + Sent: 1718487787645364, + Text: Goodbye! } }, - OnSendMessage: { - Event: { - Timestamp: 1718487787645364, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Goodbye! - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnUpdateUser: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487791901504, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_3, - CallerConnectionId: Guid_2, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.IdentityDisconnected - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -401,33 +167,20 @@ ConnectionId: Guid_1 }, oldUser: { - identity: Identity_3, - name: B, - online: true + Identity: Identity_3, + Name: B, + Online: true }, newUser: { - identity: Identity_3, - name: B, - online: false + Identity: Identity_3, + Name: B, + Online: false } }, OnInsertMessage: { eventContext: { Event: { - $type: Event.Reducer, - ReducerEvent: { - Timestamp: 1718487794937841, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Goodbye! - } - } + $type: Event.UnknownTransaction }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -437,40 +190,11 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_1, - sent: 1718487794937841, - text: Goodbye! + Sender: Identity_1, + Sent: 1718487794937841, + Text: Goodbye! } }, - OnSendMessage: { - Event: { - Timestamp: 1718487794937841, - Status: { - $type: Status.Committed - }, - CallerIdentity: Identity_1, - CallerConnectionId: Guid_3, - EnergyConsumed: {}, - Reducer: { - $type: Reducer.SendMessage, - text: Goodbye! - } - }, - Db: { - Message: { - Count: 4 - }, - User: { - Identity: {}, - Count: 3 - } - }, - Reducers: {}, - SetReducerFlags: {}, - IsActive: false, - Identity: Identity_1, - ConnectionId: Guid_1 - }, OnDeleteMessage: { eventContext: { Event: { @@ -484,9 +208,9 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_3, - sent: 1718487775346381, - text: Hello, A! + Sender: Identity_3, + Sent: 1718487775346381, + Text: Hello, A! } }, OnDeleteMessage: { @@ -502,9 +226,9 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_1, - sent: 1718487783175083, - text: Hello, B! + Sender: Identity_1, + Sent: 1718487783175083, + Text: Hello, B! } }, OnDeleteMessage: { @@ -520,9 +244,9 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_3, - sent: 1718487787645364, - text: Goodbye! + Sender: Identity_3, + Sent: 1718487787645364, + Text: Goodbye! } }, OnDeleteMessage: { @@ -538,9 +262,9 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_1, - sent: 1718487794937841, - text: Goodbye! + Sender: Identity_1, + Sent: 1718487794937841, + Text: Goodbye! } }, LogWarning: Subscription Error: $bad query dude, @@ -557,9 +281,9 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_3, - sent: 1718487775346381, - text: Hello, A! + Sender: Identity_3, + Sent: 1718487775346381, + Text: Hello, A! } }, OnInsertMessage: { @@ -575,9 +299,9 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_1, - sent: 1718487783175083, - text: Hello, B! + Sender: Identity_1, + Sent: 1718487783175083, + Text: Hello, B! } }, OnInsertMessage: { @@ -593,9 +317,9 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_3, - sent: 1718487787645364, - text: Goodbye! + Sender: Identity_3, + Sent: 1718487787645364, + Text: Goodbye! } }, OnInsertMessage: { @@ -611,49 +335,49 @@ ConnectionId: Guid_1 }, message: { - sender: Identity_1, - sent: 1718487794937841, - text: Goodbye! + Sender: Identity_1, + Sent: 1718487794937841, + Text: Goodbye! } } }, FinalSnapshot: { User: [ { - identity: Identity_1, - name: A, - online: true + Identity: Identity_1, + Name: A, + Online: true }, { - identity: Identity_2, - online: true + Identity: Identity_2, + Online: true }, { - identity: Identity_3, - name: B, - online: false + Identity: Identity_3, + Name: B, + Online: false } ], Message: [ { - sender: Identity_1, - sent: 1718487794937841, - text: Goodbye! + Sender: Identity_1, + Sent: 1718487794937841, + Text: Goodbye! }, { - sender: Identity_3, - sent: 1718487787645364, - text: Goodbye! + Sender: Identity_3, + Sent: 1718487787645364, + Text: Goodbye! }, { - sender: Identity_1, - sent: 1718487783175083, - text: Hello, B! + Sender: Identity_1, + Sent: 1718487783175083, + Text: Hello, B! }, { - sender: Identity_3, - sent: 1718487775346381, - text: Hello, A! + Sender: Identity_3, + Sent: 1718487775346381, + Text: Hello, A! } ] }, From fb5b12fba411ec44fd7c4a5fc28af4259b914a30 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 12:51:46 -0700 Subject: [PATCH 05/11] [bfops/check-bindings]: update bindings --- ...ityDisconnected.g.cs => ClientConnected.g.cs} | 16 ++++++++-------- ...ityConnected.g.cs => ClientDisconnected.g.cs} | 16 ++++++++-------- .../module_bindings/Reducers/SendMessage.g.cs | 4 ++-- .../client/module_bindings/Reducers/SetName.g.cs | 4 ++-- .../module_bindings/SpacetimeDBClient.g.cs | 14 +++++++------- .../client/module_bindings/Tables/Message.g.cs | 2 +- .../client/module_bindings/Tables/User.g.cs | 2 +- .../client/module_bindings/Types/Message.g.cs | 8 ++++---- .../client/module_bindings/Types/User.g.cs | 8 ++++---- 9 files changed, 37 insertions(+), 37 deletions(-) rename sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/{IdentityDisconnected.g.cs => ClientConnected.g.cs} (64%) rename sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/{IdentityConnected.g.cs => ClientDisconnected.g.cs} (65%) diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs similarity index 64% rename from sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs rename to sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs index 2905db1a81d..43d9afca487 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -14,12 +14,12 @@ namespace SpacetimeDB.Types { public sealed partial class RemoteReducers : RemoteBase { - public delegate void IdentityDisconnectedHandler(ReducerEventContext ctx); - public event IdentityDisconnectedHandler? OnIdentityDisconnected; + public delegate void ClientConnectedHandler(ReducerEventContext ctx); + public event ClientConnectedHandler? OnClientConnected; - public bool InvokeIdentityDisconnected(ReducerEventContext ctx, Reducer.IdentityDisconnected args) + public bool InvokeClientConnected(ReducerEventContext ctx, Reducer.ClientConnected args) { - if (OnIdentityDisconnected == null) + if (OnClientConnected == null) { if (InternalOnUnhandledReducerError != null) { @@ -31,7 +31,7 @@ public bool InvokeIdentityDisconnected(ReducerEventContext ctx, Reducer.Identity } return false; } - OnIdentityDisconnected( + OnClientConnected( ctx ); return true; @@ -42,9 +42,9 @@ public abstract partial class Reducer { [SpacetimeDB.Type] [DataContract] - public sealed partial class IdentityDisconnected : Reducer, IReducerArgs + public sealed partial class ClientConnected : Reducer, IReducerArgs { - string IReducerArgs.ReducerName => "identity_disconnected"; + string IReducerArgs.ReducerName => "ClientConnected"; } } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs similarity index 65% rename from sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs rename to sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs index d4705866624..c3ea9002f3d 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -14,12 +14,12 @@ namespace SpacetimeDB.Types { public sealed partial class RemoteReducers : RemoteBase { - public delegate void IdentityConnectedHandler(ReducerEventContext ctx); - public event IdentityConnectedHandler? OnIdentityConnected; + public delegate void ClientDisconnectedHandler(ReducerEventContext ctx); + public event ClientDisconnectedHandler? OnClientDisconnected; - public bool InvokeIdentityConnected(ReducerEventContext ctx, Reducer.IdentityConnected args) + public bool InvokeClientDisconnected(ReducerEventContext ctx, Reducer.ClientDisconnected args) { - if (OnIdentityConnected == null) + if (OnClientDisconnected == null) { if (InternalOnUnhandledReducerError != null) { @@ -31,7 +31,7 @@ public bool InvokeIdentityConnected(ReducerEventContext ctx, Reducer.IdentityCon } return false; } - OnIdentityConnected( + OnClientDisconnected( ctx ); return true; @@ -42,9 +42,9 @@ public abstract partial class Reducer { [SpacetimeDB.Type] [DataContract] - public sealed partial class IdentityConnected : Reducer, IReducerArgs + public sealed partial class ClientDisconnected : Reducer, IReducerArgs { - string IReducerArgs.ReducerName => "identity_connected"; + string IReducerArgs.ReducerName => "ClientDisconnected"; } } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs index 551618458a8..3e2f341ff11 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -63,7 +63,7 @@ public SendMessage() this.Text = ""; } - string IReducerArgs.ReducerName => "send_message"; + string IReducerArgs.ReducerName => "SendMessage"; } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs index 9b6d7cfcc70..086ee9c0322 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -63,7 +63,7 @@ public SetName() this.Name = ""; } - string IReducerArgs.ReducerName => "set_name"; + string IReducerArgs.ReducerName => "SetName"; } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs index 359ca6ab6da..17d3387e164 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -468,10 +468,10 @@ protected override Reducer ToReducer(TransactionUpdate update) var encodedArgs = update.ReducerCall.Args; return update.ReducerCall.ReducerName switch { - "identity_connected" => BSATNHelpers.Decode(encodedArgs), - "identity_disconnected" => BSATNHelpers.Decode(encodedArgs), - "send_message" => BSATNHelpers.Decode(encodedArgs), - "set_name" => BSATNHelpers.Decode(encodedArgs), + "ClientConnected" => BSATNHelpers.Decode(encodedArgs), + "ClientDisconnected" => BSATNHelpers.Decode(encodedArgs), + "SendMessage" => BSATNHelpers.Decode(encodedArgs), + "SetName" => BSATNHelpers.Decode(encodedArgs), var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") }; } @@ -493,8 +493,8 @@ protected override bool Dispatch(IReducerEventContext context, Reducer reducer) var eventContext = (ReducerEventContext)context; return reducer switch { - Reducer.IdentityConnected args => Reducers.InvokeIdentityConnected(eventContext, args), - Reducer.IdentityDisconnected args => Reducers.InvokeIdentityDisconnected(eventContext, args), + Reducer.ClientConnected args => Reducers.InvokeClientConnected(eventContext, args), + Reducer.ClientDisconnected args => Reducers.InvokeClientDisconnected(eventContext, args), Reducer.SendMessage args => Reducers.InvokeSendMessage(eventContext, args), Reducer.SetName args => Reducers.InvokeSetName(eventContext, args), _ => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs index 73c30ae33e5..f9bff5ccc85 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs index 8c5945a237f..6a735ae9b38 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs index a386797d9b9..3daf7bf2067 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -15,11 +15,11 @@ namespace SpacetimeDB.Types [DataContract] public sealed partial class Message { - [DataMember(Name = "sender")] + [DataMember(Name = "Sender")] public SpacetimeDB.Identity Sender; - [DataMember(Name = "sent")] + [DataMember(Name = "Sent")] public SpacetimeDB.Timestamp Sent; - [DataMember(Name = "text")] + [DataMember(Name = "Text")] public string Text; public Message( diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs index 4dcf8eb52fb..ebb0a11c936 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). +// This was generated using spacetimedb cli version 1.2.0 (commit ). #nullable enable @@ -15,11 +15,11 @@ namespace SpacetimeDB.Types [DataContract] public sealed partial class User { - [DataMember(Name = "identity")] + [DataMember(Name = "Identity")] public SpacetimeDB.Identity Identity; - [DataMember(Name = "name")] + [DataMember(Name = "Name")] public string? Name; - [DataMember(Name = "online")] + [DataMember(Name = "Online")] public bool Online; public User( From 60aafb089e43938df4df95f8909fec8721448f09 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 14:58:42 -0700 Subject: [PATCH 06/11] [bfops/check-bindings]: whitespace --- .../client/module_bindings/SpacetimeDBClient.g.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs index 17d3387e164..0543b8d69b8 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs @@ -385,11 +385,11 @@ Action callback /// /// Subscribe to the following SQL queries. - /// + /// /// This method returns immediately, with the data not yet added to the DbConnection. /// The provided callbacks will be invoked once the data is returned from the remote server. /// Data from all the provided queries will be returned at the same time. - /// + /// /// See the SpacetimeDB SQL docs for more information on SQL syntax: /// https://spacetimedb.com/docs/sql /// From 3e1347acd9cfbf56e2e53b8d8b37dfb3e86810b1 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 15:01:23 -0700 Subject: [PATCH 07/11] [bfops/check-bindings]: revert --- .../Reducers/IdentityConnected.g.cs | 50 ++ .../Reducers/IdentityDisconnected.g.cs | 50 ++ .../module_bindings/Reducers/SendMessage.g.cs | 4 +- .../module_bindings/Reducers/SetName.g.cs | 4 +- .../module_bindings/SpacetimeDBClient.g.cs | 18 +- .../module_bindings/Tables/Message.g.cs | 2 +- .../client/module_bindings/Tables/User.g.cs | 2 +- .../client/module_bindings/Types/Message.g.cs | 8 +- .../client/module_bindings/Types/User.g.cs | 8 +- ...p_dumpName=LegacySubscribeAll.verified.txt | 402 +++++++++++++--- ...ump_dumpName=SubscribeApplied.verified.txt | 450 ++++++++++++++---- 11 files changed, 825 insertions(+), 173 deletions(-) create mode 100644 sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs create mode 100644 sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs new file mode 100644 index 00000000000..d4705866624 --- /dev/null +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityConnected.g.cs @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). + +#nullable enable + +using System; +using SpacetimeDB.ClientApi; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Types +{ + public sealed partial class RemoteReducers : RemoteBase + { + public delegate void IdentityConnectedHandler(ReducerEventContext ctx); + public event IdentityConnectedHandler? OnIdentityConnected; + + public bool InvokeIdentityConnected(ReducerEventContext ctx, Reducer.IdentityConnected args) + { + if (OnIdentityConnected == null) + { + if (InternalOnUnhandledReducerError != null) + { + switch (ctx.Event.Status) + { + case Status.Failed(var reason): InternalOnUnhandledReducerError(ctx, new Exception(reason)); break; + case Status.OutOfEnergy(var _): InternalOnUnhandledReducerError(ctx, new Exception("out of energy")); break; + } + } + return false; + } + OnIdentityConnected( + ctx + ); + return true; + } + } + + public abstract partial class Reducer + { + [SpacetimeDB.Type] + [DataContract] + public sealed partial class IdentityConnected : Reducer, IReducerArgs + { + string IReducerArgs.ReducerName => "identity_connected"; + } + } +} diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs new file mode 100644 index 00000000000..2905db1a81d --- /dev/null +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/IdentityDisconnected.g.cs @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). + +#nullable enable + +using System; +using SpacetimeDB.ClientApi; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace SpacetimeDB.Types +{ + public sealed partial class RemoteReducers : RemoteBase + { + public delegate void IdentityDisconnectedHandler(ReducerEventContext ctx); + public event IdentityDisconnectedHandler? OnIdentityDisconnected; + + public bool InvokeIdentityDisconnected(ReducerEventContext ctx, Reducer.IdentityDisconnected args) + { + if (OnIdentityDisconnected == null) + { + if (InternalOnUnhandledReducerError != null) + { + switch (ctx.Event.Status) + { + case Status.Failed(var reason): InternalOnUnhandledReducerError(ctx, new Exception(reason)); break; + case Status.OutOfEnergy(var _): InternalOnUnhandledReducerError(ctx, new Exception("out of energy")); break; + } + } + return false; + } + OnIdentityDisconnected( + ctx + ); + return true; + } + } + + public abstract partial class Reducer + { + [SpacetimeDB.Type] + [DataContract] + public sealed partial class IdentityDisconnected : Reducer, IReducerArgs + { + string IReducerArgs.ReducerName => "identity_disconnected"; + } + } +} diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs index 3e2f341ff11..551618458a8 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SendMessage.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -63,7 +63,7 @@ public SendMessage() this.Text = ""; } - string IReducerArgs.ReducerName => "SendMessage"; + string IReducerArgs.ReducerName => "send_message"; } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs index 086ee9c0322..9b6d7cfcc70 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/SetName.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -63,7 +63,7 @@ public SetName() this.Name = ""; } - string IReducerArgs.ReducerName => "SetName"; + string IReducerArgs.ReducerName => "set_name"; } } diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs index 0543b8d69b8..359ca6ab6da 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -385,11 +385,11 @@ Action callback /// /// Subscribe to the following SQL queries. - /// + /// /// This method returns immediately, with the data not yet added to the DbConnection. /// The provided callbacks will be invoked once the data is returned from the remote server. /// Data from all the provided queries will be returned at the same time. - /// + /// /// See the SpacetimeDB SQL docs for more information on SQL syntax: /// https://spacetimedb.com/docs/sql /// @@ -468,10 +468,10 @@ protected override Reducer ToReducer(TransactionUpdate update) var encodedArgs = update.ReducerCall.Args; return update.ReducerCall.ReducerName switch { - "ClientConnected" => BSATNHelpers.Decode(encodedArgs), - "ClientDisconnected" => BSATNHelpers.Decode(encodedArgs), - "SendMessage" => BSATNHelpers.Decode(encodedArgs), - "SetName" => BSATNHelpers.Decode(encodedArgs), + "identity_connected" => BSATNHelpers.Decode(encodedArgs), + "identity_disconnected" => BSATNHelpers.Decode(encodedArgs), + "send_message" => BSATNHelpers.Decode(encodedArgs), + "set_name" => BSATNHelpers.Decode(encodedArgs), var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") }; } @@ -493,8 +493,8 @@ protected override bool Dispatch(IReducerEventContext context, Reducer reducer) var eventContext = (ReducerEventContext)context; return reducer switch { - Reducer.ClientConnected args => Reducers.InvokeClientConnected(eventContext, args), - Reducer.ClientDisconnected args => Reducers.InvokeClientDisconnected(eventContext, args), + Reducer.IdentityConnected args => Reducers.InvokeIdentityConnected(eventContext, args), + Reducer.IdentityDisconnected args => Reducers.InvokeIdentityDisconnected(eventContext, args), Reducer.SendMessage args => Reducers.InvokeSendMessage(eventContext, args), Reducer.SetName args => Reducers.InvokeSetName(eventContext, args), _ => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}") diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs index f9bff5ccc85..73c30ae33e5 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/Message.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs index 6a735ae9b38..8c5945a237f 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Tables/User.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs index 3daf7bf2067..a386797d9b9 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/Message.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -15,11 +15,11 @@ namespace SpacetimeDB.Types [DataContract] public sealed partial class Message { - [DataMember(Name = "Sender")] + [DataMember(Name = "sender")] public SpacetimeDB.Identity Sender; - [DataMember(Name = "Sent")] + [DataMember(Name = "sent")] public SpacetimeDB.Timestamp Sent; - [DataMember(Name = "Text")] + [DataMember(Name = "text")] public string Text; public Message( diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs index ebb0a11c936..4dcf8eb52fb 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Types/User.g.cs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 1.2.0 (commit ). +// This was generated using spacetimedb cli version 1.1.1 (commit bc3d453e871c797c17fdab2d772019832cd9b73e). #nullable enable @@ -15,11 +15,11 @@ namespace SpacetimeDB.Types [DataContract] public sealed partial class User { - [DataMember(Name = "Identity")] + [DataMember(Name = "identity")] public SpacetimeDB.Identity Identity; - [DataMember(Name = "Name")] + [DataMember(Name = "name")] public string? Name; - [DataMember(Name = "Online")] + [DataMember(Name = "online")] public bool Online; public User( diff --git a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt index cf5dc7f390e..ad04d010a6e 100644 --- a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt +++ b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt @@ -1,4 +1,4 @@ -{ +{ Events: { Log: SpacetimeDBClient: Connecting to wss://spacetimedb.com example, OnConnect: { @@ -18,8 +18,8 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_1, - Online: true + identity: Identity_1, + online: true } }, OnInsertUser: { @@ -35,14 +35,26 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_2, - Online: true + identity: Identity_2, + online: true } }, OnInsertUser: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487763059031, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.IdentityConnected + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -52,14 +64,27 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_3, - Online: true + identity: Identity_3, + online: true } }, OnUpdateUser: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487768057579, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: A + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -69,19 +94,61 @@ ConnectionId: Guid_1 }, oldUser: { - Identity: Identity_1, - Online: true + identity: Identity_1, + online: true }, newUser: { - Identity: Identity_1, - Name: A, - Online: true + identity: Identity_1, + name: A, + online: true } }, + OnSetName: { + Event: { + Timestamp: 1718487768057579, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: A + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnInsertMessage: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487775346381, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, A! + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -91,15 +158,57 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } }, + OnSendMessage: { + Event: { + Timestamp: 1718487775346381, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, A! + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnUpdateUser: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487777307855, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: B + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -109,19 +218,61 @@ ConnectionId: Guid_1 }, oldUser: { - Identity: Identity_3, - Online: true + identity: Identity_3, + online: true }, newUser: { - Identity: Identity_3, - Name: B, - Online: true + identity: Identity_3, + name: B, + online: true } }, + OnSetName: { + Event: { + Timestamp: 1718487777307855, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: B + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnInsertMessage: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487783175083, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, B! + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -131,15 +282,57 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! } }, + OnSendMessage: { + Event: { + Timestamp: 1718487783175083, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, B! + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnInsertMessage: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487787645364, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -149,15 +342,56 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! } }, + OnSendMessage: { + Event: { + Timestamp: 1718487787645364, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnUpdateUser: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487791901504, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.IdentityDisconnected + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -167,20 +401,33 @@ ConnectionId: Guid_1 }, oldUser: { - Identity: Identity_3, - Name: B, - Online: true + identity: Identity_3, + name: B, + online: true }, newUser: { - Identity: Identity_3, - Name: B, - Online: false + identity: Identity_3, + name: B, + online: false } }, OnInsertMessage: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487794937841, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -190,49 +437,78 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487794937841, - Text: Goodbye! + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! } + }, + OnSendMessage: { + Event: { + Timestamp: 1718487794937841, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 } }, FinalSnapshot: { User: [ { - Identity: Identity_1, - Name: A, - Online: true + identity: Identity_1, + name: A, + online: true }, { - Identity: Identity_2, - Online: true + identity: Identity_2, + online: true }, { - Identity: Identity_3, - Name: B, - Online: false + identity: Identity_3, + name: B, + online: false } ], Message: [ { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! }, { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! }, { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! }, { - Sender: Identity_1, - Sent: 1718487794937841, - Text: Goodbye! + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! } ] }, diff --git a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt index 006237378b7..9368d6d83a9 100644 --- a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt +++ b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt @@ -1,4 +1,4 @@ -{ +{ Events: { Log: SpacetimeDBClient: Connecting to wss://spacetimedb.com example, OnConnect: { @@ -18,8 +18,8 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_1, - Online: true + identity: Identity_1, + online: true } }, OnInsertUser: { @@ -35,14 +35,26 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_2, - Online: true + identity: Identity_2, + online: true } }, OnInsertUser: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487763059031, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.IdentityConnected + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -52,14 +64,27 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_3, - Online: true + identity: Identity_3, + online: true } }, OnUpdateUser: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487768057579, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: A + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -69,19 +94,61 @@ ConnectionId: Guid_1 }, oldUser: { - Identity: Identity_1, - Online: true + identity: Identity_1, + online: true }, newUser: { - Identity: Identity_1, - Name: A, - Online: true + identity: Identity_1, + name: A, + online: true } }, + OnSetName: { + Event: { + Timestamp: 1718487768057579, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: A + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnInsertMessage: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487775346381, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, A! + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -91,15 +158,57 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } }, + OnSendMessage: { + Event: { + Timestamp: 1718487775346381, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, A! + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnUpdateUser: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487777307855, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: B + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -109,19 +218,61 @@ ConnectionId: Guid_1 }, oldUser: { - Identity: Identity_3, - Online: true + identity: Identity_3, + online: true }, newUser: { - Identity: Identity_3, - Name: B, - Online: true + identity: Identity_3, + name: B, + online: true } }, + OnSetName: { + Event: { + Timestamp: 1718487777307855, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SetName, + name: B + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnInsertMessage: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487783175083, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, B! + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -131,15 +282,57 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! } }, + OnSendMessage: { + Event: { + Timestamp: 1718487783175083, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Hello, B! + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnInsertMessage: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487787645364, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -149,15 +342,56 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! } }, + OnSendMessage: { + Event: { + Timestamp: 1718487787645364, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnUpdateUser: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487791901504, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_3, + CallerConnectionId: Guid_2, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.IdentityDisconnected + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -167,20 +401,33 @@ ConnectionId: Guid_1 }, oldUser: { - Identity: Identity_3, - Name: B, - Online: true + identity: Identity_3, + name: B, + online: true }, newUser: { - Identity: Identity_3, - Name: B, - Online: false + identity: Identity_3, + name: B, + online: false } }, OnInsertMessage: { eventContext: { Event: { - $type: Event.UnknownTransaction + $type: Event.Reducer, + ReducerEvent: { + Timestamp: 1718487794937841, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + } }, Db: {Scrubbed}, Reducers: {Scrubbed}, @@ -190,11 +437,40 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487794937841, - Text: Goodbye! + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! } }, + OnSendMessage: { + Event: { + Timestamp: 1718487794937841, + Status: { + $type: Status.Committed + }, + CallerIdentity: Identity_1, + CallerConnectionId: Guid_3, + EnergyConsumed: {}, + Reducer: { + $type: Reducer.SendMessage, + text: Goodbye! + } + }, + Db: { + Message: { + Count: 4 + }, + User: { + Identity: {}, + Count: 3 + } + }, + Reducers: {}, + SetReducerFlags: {}, + IsActive: false, + Identity: Identity_1, + ConnectionId: Guid_1 + }, OnDeleteMessage: { eventContext: { Event: { @@ -208,9 +484,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } }, OnDeleteMessage: { @@ -226,9 +502,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! } }, OnDeleteMessage: { @@ -244,9 +520,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! } }, OnDeleteMessage: { @@ -262,9 +538,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487794937841, - Text: Goodbye! + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! } }, LogWarning: Subscription Error: $bad query dude, @@ -281,9 +557,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } }, OnInsertMessage: { @@ -299,9 +575,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! } }, OnInsertMessage: { @@ -317,9 +593,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! } }, OnInsertMessage: { @@ -335,49 +611,49 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487794937841, - Text: Goodbye! + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! } } }, FinalSnapshot: { User: [ { - Identity: Identity_1, - Name: A, - Online: true + identity: Identity_1, + name: A, + online: true }, { - Identity: Identity_2, - Online: true + identity: Identity_2, + online: true }, { - Identity: Identity_3, - Name: B, - Online: false + identity: Identity_3, + name: B, + online: false } ], Message: [ { - Sender: Identity_1, - Sent: 1718487794937841, - Text: Goodbye! + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! }, { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! }, { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! }, { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } ] }, From 42b950171abb3ad02a7d33dd0c8c0314760101c3 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 15:01:47 -0700 Subject: [PATCH 08/11] [bfops/check-bindings]: rm --- .../Reducers/ClientConnected.g.cs | 50 ------------------- .../Reducers/ClientDisconnected.g.cs | 50 ------------------- 2 files changed, 100 deletions(-) delete mode 100644 sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs delete mode 100644 sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs deleted file mode 100644 index 43d9afca487..00000000000 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientConnected.g.cs +++ /dev/null @@ -1,50 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -// This was generated using spacetimedb cli version 1.2.0 (commit ). - -#nullable enable - -using System; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteReducers : RemoteBase - { - public delegate void ClientConnectedHandler(ReducerEventContext ctx); - public event ClientConnectedHandler? OnClientConnected; - - public bool InvokeClientConnected(ReducerEventContext ctx, Reducer.ClientConnected args) - { - if (OnClientConnected == null) - { - if (InternalOnUnhandledReducerError != null) - { - switch (ctx.Event.Status) - { - case Status.Failed(var reason): InternalOnUnhandledReducerError(ctx, new Exception(reason)); break; - case Status.OutOfEnergy(var _): InternalOnUnhandledReducerError(ctx, new Exception("out of energy")); break; - } - } - return false; - } - OnClientConnected( - ctx - ); - return true; - } - } - - public abstract partial class Reducer - { - [SpacetimeDB.Type] - [DataContract] - public sealed partial class ClientConnected : Reducer, IReducerArgs - { - string IReducerArgs.ReducerName => "ClientConnected"; - } - } -} diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs deleted file mode 100644 index c3ea9002f3d..00000000000 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/Reducers/ClientDisconnected.g.cs +++ /dev/null @@ -1,50 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE -// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. - -// This was generated using spacetimedb cli version 1.2.0 (commit ). - -#nullable enable - -using System; -using SpacetimeDB.ClientApi; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace SpacetimeDB.Types -{ - public sealed partial class RemoteReducers : RemoteBase - { - public delegate void ClientDisconnectedHandler(ReducerEventContext ctx); - public event ClientDisconnectedHandler? OnClientDisconnected; - - public bool InvokeClientDisconnected(ReducerEventContext ctx, Reducer.ClientDisconnected args) - { - if (OnClientDisconnected == null) - { - if (InternalOnUnhandledReducerError != null) - { - switch (ctx.Event.Status) - { - case Status.Failed(var reason): InternalOnUnhandledReducerError(ctx, new Exception(reason)); break; - case Status.OutOfEnergy(var _): InternalOnUnhandledReducerError(ctx, new Exception("out of energy")); break; - } - } - return false; - } - OnClientDisconnected( - ctx - ); - return true; - } - } - - public abstract partial class Reducer - { - [SpacetimeDB.Type] - [DataContract] - public sealed partial class ClientDisconnected : Reducer, IReducerArgs - { - string IReducerArgs.ReducerName => "ClientDisconnected"; - } - } -} From 58f1e975fc44e91740d53cf9f06a10c4f1a41379 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 15:22:19 -0700 Subject: [PATCH 09/11] [bfops/check-bindings]: empty commit to bump CI From 48ff31dd7f6d561dd733d564ce7c2f768201383a Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 24 Jul 2025 16:40:34 -0700 Subject: [PATCH 10/11] [bfops/check-bindings]: tweak error message --- .github/workflows/csharp-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/csharp-test.yml b/.github/workflows/csharp-test.yml index 345715332c5..e29901feacb 100644 --- a/.github/workflows/csharp-test.yml +++ b/.github/workflows/csharp-test.yml @@ -85,7 +85,7 @@ jobs: # version, which would make this `git diff` check very brittle if included. PATTERN='^// This was generated using spacetimedb cli version.*' git diff --exit-code --ignore-matching-lines="$PATTERN" -- . || { - echo "Error: Bindings have changed. Please generate bindings again and commit them to this branch." + echo "Error: quickstart-chat bindings have changed. Please regenerate the bindings and commit them to this branch." exit 1 } From faea68f861e13e6d5776c11d22808ba6ab9bc326 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Fri, 25 Jul 2025 10:06:21 -0700 Subject: [PATCH 11/11] [bfops/check-bindings]: fix whitespace --- .../client/module_bindings/SpacetimeDBClient.g.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs index d025ee74fb3..29b23559fbc 100644 --- a/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs +++ b/sdks/csharp/examples~/quickstart-chat/client/module_bindings/SpacetimeDBClient.g.cs @@ -385,11 +385,11 @@ Action callback /// /// Subscribe to the following SQL queries. - /// + /// /// This method returns immediately, with the data not yet added to the DbConnection. /// The provided callbacks will be invoked once the data is returned from the remote server. /// Data from all the provided queries will be returned at the same time. - /// + /// /// See the SpacetimeDB SQL docs for more information on SQL syntax: /// https://spacetimedb.com/docs/sql ///