From 832885f2c5be75d316fc13f38bde3c216bae65ab Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 7 May 2026 10:58:20 -0700 Subject: [PATCH 1/4] [bfops/fix-quickstart-ci]: CI - Fix gen-quickstart check --- .github/workflows/ci.yml | 5 ++--- .../module_bindings/Reducers/SendMessage.g.cs | 2 +- .../module_bindings/Reducers/SetName.g.cs | 2 +- .../module_bindings/SpacetimeDBClient.g.cs | 6 +++--- .../module_bindings/Tables/Message.g.cs | 8 ++++---- .../module_bindings/Tables/User.g.cs | 18 +++++++++--------- .../module_bindings/Types/Message.g.cs | 6 +++--- .../module_bindings/Types/User.g.cs | 6 +++--- 8 files changed, 26 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bb00eb6f12..bd0c4f24225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -830,10 +830,9 @@ jobs: ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime - name: Check quickstart-chat bindings are up to date - working-directory: sdks/csharp run: | - bash tools~/gen-quickstart.sh - "${GITHUB_WORKSPACE}"/tools/check-diff.sh examples~/quickstart-chat || { + bash sdks/csharp/tools~/gen-quickstart.sh + tools/check-diff.sh templates/chat-console-cs/module_bindings/ || { echo 'Error: quickstart-chat bindings have changed. Please run `sdks/csharp/tools~/gen-quickstart.sh`.' exit 1 } diff --git a/templates/chat-console-cs/module_bindings/Reducers/SendMessage.g.cs b/templates/chat-console-cs/module_bindings/Reducers/SendMessage.g.cs index 9765d7f0588..caa1bf37165 100644 --- a/templates/chat-console-cs/module_bindings/Reducers/SendMessage.g.cs +++ b/templates/chat-console-cs/module_bindings/Reducers/SendMessage.g.cs @@ -61,7 +61,7 @@ public SendMessage() this.Text = ""; } - string IReducerArgs.ReducerName => "SendMessage"; + string IReducerArgs.ReducerName => "send_message"; } } } diff --git a/templates/chat-console-cs/module_bindings/Reducers/SetName.g.cs b/templates/chat-console-cs/module_bindings/Reducers/SetName.g.cs index 10ac5b9da27..fc905ecc50c 100644 --- a/templates/chat-console-cs/module_bindings/Reducers/SetName.g.cs +++ b/templates/chat-console-cs/module_bindings/Reducers/SetName.g.cs @@ -61,7 +61,7 @@ public SetName() this.Name = ""; } - string IReducerArgs.ReducerName => "SetName"; + string IReducerArgs.ReducerName => "set_name"; } } } diff --git a/templates/chat-console-cs/module_bindings/SpacetimeDBClient.g.cs b/templates/chat-console-cs/module_bindings/SpacetimeDBClient.g.cs index df41f08dc4d..4020b9de9cf 100644 --- a/templates/chat-console-cs/module_bindings/SpacetimeDBClient.g.cs +++ b/templates/chat-console-cs/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 2.0.0 (commit 5183461758f0c9cb05138a5054c947a7aeb8497e). +// This was generated using spacetimedb cli version 2.2.0 (commit c7b94639a4322ec5e3d58c85460175cd23ca3f1f). #nullable enable @@ -533,8 +533,8 @@ public sealed class QueryBuilder public sealed class From { - public global::SpacetimeDB.Table Message() => new("Message", new MessageCols("Message"), new MessageIxCols("Message")); - public global::SpacetimeDB.Table User() => new("User", new UserCols("User"), new UserIxCols("User")); + public global::SpacetimeDB.Table Message() => new("message", new MessageCols("message"), new MessageIxCols("message")); + public global::SpacetimeDB.Table User() => new("user", new UserCols("user"), new UserIxCols("user")); } public sealed class TypedSubscriptionBuilder diff --git a/templates/chat-console-cs/module_bindings/Tables/Message.g.cs b/templates/chat-console-cs/module_bindings/Tables/Message.g.cs index a21ee4d37f6..b4cc7f92dc0 100644 --- a/templates/chat-console-cs/module_bindings/Tables/Message.g.cs +++ b/templates/chat-console-cs/module_bindings/Tables/Message.g.cs @@ -15,7 +15,7 @@ public sealed partial class RemoteTables { public sealed class MessageHandle : RemoteTableHandle { - protected override string RemoteTableName => "Message"; + protected override string RemoteTableName => "message"; internal MessageHandle(DbConnection conn) : base(conn) { @@ -33,9 +33,9 @@ public sealed class MessageCols public MessageCols(string tableName) { - Sender = new global::SpacetimeDB.Col(tableName, "Sender"); - Sent = new global::SpacetimeDB.Col(tableName, "Sent"); - Text = new global::SpacetimeDB.Col(tableName, "Text"); + Sender = new global::SpacetimeDB.Col(tableName, "sender"); + Sent = new global::SpacetimeDB.Col(tableName, "sent"); + Text = new global::SpacetimeDB.Col(tableName, "text"); } } diff --git a/templates/chat-console-cs/module_bindings/Tables/User.g.cs b/templates/chat-console-cs/module_bindings/Tables/User.g.cs index aa152f5c5a1..1f7a507b39b 100644 --- a/templates/chat-console-cs/module_bindings/Tables/User.g.cs +++ b/templates/chat-console-cs/module_bindings/Tables/User.g.cs @@ -15,20 +15,20 @@ public sealed partial class RemoteTables { public sealed class UserHandle : RemoteTableHandle { - protected override string RemoteTableName => "User"; + protected override string RemoteTableName => "user"; - public sealed class UserIdentityIdxBtreeUniqueIndex : UniqueIndexBase + public sealed class IdentityUniqueIndex : UniqueIndexBase { protected override SpacetimeDB.Identity GetKey(User row) => row.Identity; - public UserIdentityIdxBtreeUniqueIndex(UserHandle table) : base(table) { } + public IdentityUniqueIndex(UserHandle table) : base(table) { } } - public readonly UserIdentityIdxBtreeUniqueIndex UserIdentityIdxBtree; + public readonly IdentityUniqueIndex Identity; internal UserHandle(DbConnection conn) : base(conn) { - UserIdentityIdxBtree = new(this); + Identity = new(this); } protected override object GetPrimaryKey(User row) => row.Identity; @@ -45,9 +45,9 @@ public sealed class UserCols public UserCols(string tableName) { - Identity = new global::SpacetimeDB.Col(tableName, "Identity"); - Name = new global::SpacetimeDB.Col(tableName, "Name"); - Online = new global::SpacetimeDB.Col(tableName, "Online"); + Identity = new global::SpacetimeDB.Col(tableName, "identity"); + Name = new global::SpacetimeDB.Col(tableName, "name"); + Online = new global::SpacetimeDB.Col(tableName, "online"); } } @@ -57,7 +57,7 @@ public sealed class UserIxCols public UserIxCols(string tableName) { - Identity = new global::SpacetimeDB.IxCol(tableName, "Identity"); + Identity = new global::SpacetimeDB.IxCol(tableName, "identity"); } } } diff --git a/templates/chat-console-cs/module_bindings/Types/Message.g.cs b/templates/chat-console-cs/module_bindings/Types/Message.g.cs index 7884e05ba69..09ddde48c83 100644 --- a/templates/chat-console-cs/module_bindings/Types/Message.g.cs +++ b/templates/chat-console-cs/module_bindings/Types/Message.g.cs @@ -13,11 +13,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/templates/chat-console-cs/module_bindings/Types/User.g.cs b/templates/chat-console-cs/module_bindings/Types/User.g.cs index 1ea36227cc1..134f3332fd2 100644 --- a/templates/chat-console-cs/module_bindings/Types/User.g.cs +++ b/templates/chat-console-cs/module_bindings/Types/User.g.cs @@ -13,11 +13,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 c22509da443c8376d4f7d9522c18bd0dc459dd30 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 7 May 2026 11:00:02 -0700 Subject: [PATCH 2/4] [bfops/fix-quickstart-ci]: trailing slash --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd0c4f24225..3cb5a99c331 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -832,7 +832,7 @@ jobs: - name: Check quickstart-chat bindings are up to date run: | bash sdks/csharp/tools~/gen-quickstart.sh - tools/check-diff.sh templates/chat-console-cs/module_bindings/ || { + tools/check-diff.sh templates/chat-console-cs/module_bindings || { echo 'Error: quickstart-chat bindings have changed. Please run `sdks/csharp/tools~/gen-quickstart.sh`.' exit 1 } From e482c489164a2e36335d85322d148a0e55a573c8 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 7 May 2026 12:19:41 -0700 Subject: [PATCH 3/4] [bfops/fix-quickstart-ci]: fix --- templates/chat-console-cs/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/chat-console-cs/Program.cs b/templates/chat-console-cs/Program.cs index 4c5164e3432..da2945589cb 100644 --- a/templates/chat-console-cs/Program.cs +++ b/templates/chat-console-cs/Program.cs @@ -143,7 +143,7 @@ void Message_OnInsert(EventContext ctx, Message insertedValue) void PrintMessage(RemoteTables tables, Message message) { - var sender = tables.User.UserIdentityIdxBtree.Find(message.Sender); + var sender = tables.User.Identity.Find(message.Sender); var senderName = "unknown"; if (sender != null) { From 7d630bf8c3909c444ed2d768091e6ebe5fe2c95a Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Thu, 7 May 2026 12:22:09 -0700 Subject: [PATCH 4/4] [bfops/fix-quickstart-ci]: updates --- ...p_dumpName=LegacySubscribeAll.verified.txt | 114 ++++++------- ...ump_dumpName=SubscribeApplied.verified.txt | 160 +++++++++--------- sdks/csharp/tests~/SnapshotTests.cs | 4 +- 3 files changed, 139 insertions(+), 139 deletions(-) diff --git a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt index 7fb26dd022b..5ae3339cfaa 100644 --- a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt +++ b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=LegacySubscribeAll.verified.txt @@ -18,8 +18,8 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_1, - Online: true + identity: Identity_1, + online: true } }, OnInsertUser: { @@ -35,8 +35,8 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_2, - Online: true + identity: Identity_2, + online: true } }, OnInsertUser: { @@ -52,8 +52,8 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_3, - Online: true + identity: Identity_3, + online: true } }, OnUpdateUser: { @@ -81,13 +81,13 @@ 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: { @@ -109,7 +109,7 @@ Count: 4 }, User: { - UserIdentityIdxBtree: {}, + Identity: {}, Count: 3 } }, @@ -141,7 +141,7 @@ Count: 4 }, User: { - UserIdentityIdxBtree: {}, + Identity: {}, Count: 3 } }, @@ -173,7 +173,7 @@ Count: 4 }, User: { - UserIdentityIdxBtree: {}, + Identity: {}, Count: 3 } }, @@ -198,13 +198,13 @@ 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 } }, OnInsertMessage: { @@ -220,9 +220,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } }, OnInsertMessage: { @@ -238,9 +238,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! } }, OnInsertMessage: { @@ -256,9 +256,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! } }, OnUpdateUser: { @@ -274,14 +274,14 @@ 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: { @@ -297,49 +297,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_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 15af7288130..7dd87750886 100644 --- a/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt +++ b/sdks/csharp/tests~/SnapshotTests.VerifySampleDump_dumpName=SubscribeApplied.verified.txt @@ -18,8 +18,8 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_1, - Online: true + identity: Identity_1, + online: true } }, OnInsertUser: { @@ -35,8 +35,8 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_2, - Online: true + identity: Identity_2, + online: true } }, OnInsertUser: { @@ -52,8 +52,8 @@ ConnectionId: Guid_1 }, user: { - Identity: Identity_3, - Online: true + identity: Identity_3, + online: true } }, OnUpdateUser: { @@ -81,13 +81,13 @@ 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: { @@ -109,7 +109,7 @@ Count: 4 }, User: { - UserIdentityIdxBtree: {}, + Identity: {}, Count: 3 } }, @@ -141,7 +141,7 @@ Count: 4 }, User: { - UserIdentityIdxBtree: {}, + Identity: {}, Count: 3 } }, @@ -166,13 +166,13 @@ 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 } }, OnInsertMessage: { @@ -188,9 +188,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } }, OnInsertMessage: { @@ -206,9 +206,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! } }, OnInsertMessage: { @@ -224,9 +224,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! } }, OnUpdateUser: { @@ -242,14 +242,14 @@ 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: { @@ -265,9 +265,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487794937841, - Text: Goodbye! + sender: Identity_1, + sent: 1718487794937841, + text: Goodbye! } }, OnDeleteMessage: { @@ -283,9 +283,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } }, OnDeleteMessage: { @@ -301,9 +301,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! } }, OnDeleteMessage: { @@ -319,9 +319,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! } }, OnDeleteMessage: { @@ -337,9 +337,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, @@ -357,9 +357,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487775346381, - Text: Hello, A! + sender: Identity_3, + sent: 1718487775346381, + text: Hello, A! } }, OnInsertMessage: { @@ -375,9 +375,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_1, - Sent: 1718487783175083, - Text: Hello, B! + sender: Identity_1, + sent: 1718487783175083, + text: Hello, B! } }, OnInsertMessage: { @@ -393,9 +393,9 @@ ConnectionId: Guid_1 }, message: { - Sender: Identity_3, - Sent: 1718487787645364, - Text: Goodbye! + sender: Identity_3, + sent: 1718487787645364, + text: Goodbye! } }, OnInsertMessage: { @@ -411,49 +411,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! } ] }, diff --git a/sdks/csharp/tests~/SnapshotTests.cs b/sdks/csharp/tests~/SnapshotTests.cs index e083928111e..95a188c8553 100644 --- a/sdks/csharp/tests~/SnapshotTests.cs +++ b/sdks/csharp/tests~/SnapshotTests.cs @@ -257,8 +257,8 @@ private static List EncodeBsatnString(string value) return [.. o.ToArray()]; } - private static readonly string USER_TABLE_NAME = "User"; - private static readonly string MESSAGE_TABLE_NAME = "Message"; + private static readonly string USER_TABLE_NAME = "user"; + private static readonly string MESSAGE_TABLE_NAME = "message"; private static TableUpdate SampleUserInsert(string identity, string? name, bool online) =>