Skip to content

Commit

Permalink
[release/candidate/v0.10.1]: Cherry-pick (#1461) Fixed exceptions in …
Browse files Browse the repository at this point in the history
…C# SDK when someone disconnects or when a transaction originates from CLI

Co-authored-by: Steve Boytsun <[email protected]>
  • Loading branch information
2 people authored and Zeke Foppa committed Jun 26, 2024
1 parent 5889691 commit 70eaf1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/cli/src/subcommands/generate/csharp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,9 @@ pub fn autogen_csharp_globals(items: &[GenItem], namespace: &str) -> Vec<(String
);
}
writeln!(output, "\"<none>\" => null,");
writeln!(output, "\"__identity_connected__\" => null,");
writeln!(output, "\"__identity_disconnected__\" => null,");
writeln!(output, "\"\" => null,"); //Transaction from CLI command
writeln!(
output,
r#"var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {{reducer}}")"#
Expand Down
3 changes: 3 additions & 0 deletions crates/cli/tests/snapshots/codegen__codegen_csharp.snap
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,9 @@ namespace SpacetimeDB
"repeating_test" => BSATNHelpers.FromProtoBytes<RepeatingTestArgsStruct>(argBytes),
"test" => BSATNHelpers.FromProtoBytes<TestArgsStruct>(argBytes),
"<none>" => null,
"__identity_connected__" => null,
"__identity_disconnected__" => null,
"" => null,
var reducer => throw new ArgumentOutOfRangeException("Reducer", $"Unknown reducer {reducer}")
};
return new ReducerEvent(dbEvent, args);
Expand Down

0 comments on commit 70eaf1d

Please sign in to comment.