Skip to content

Commit 69a2ab7

Browse files
authored
Fix SDK bug with overlapping subscriptions (#2711)
1 parent a056796 commit 69a2ab7

404 files changed

Lines changed: 804 additions & 568 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

crates/codegen/src/rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate {
10001000
for table in iter_tables(module) {
10011001
writeln!(
10021002
out,
1003-
"{:?} => db_update.{} = {}::parse_table_update(table_update)?,",
1003+
"{:?} => db_update.{}.append({}::parse_table_update(table_update)?),",
10041004
table.name.deref(),
10051005
table_method_name(&table.name),
10061006
table_module_name(&table.name),

crates/codegen/tests/snapshots/codegen__codegen_rust.snap

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
source: crates/cli/tests/codegen.rs
2+
source: crates/codegen/tests/codegen.rs
33
expression: outfiles
44
---
55
"add_player_reducer.rs" = '''
@@ -1611,18 +1611,18 @@ impl TryFrom<__ws::DatabaseUpdate<__ws::BsatnFormat>> for DbUpdate {
16111611
for table_update in raw.tables {
16121612
match &table_update.table_name[..] {
16131613

1614-
"has_special_stuff" => db_update.has_special_stuff = has_special_stuff_table::parse_table_update(table_update)?,
1615-
"logged_out_player" => db_update.logged_out_player = logged_out_player_table::parse_table_update(table_update)?,
1616-
"person" => db_update.person = person_table::parse_table_update(table_update)?,
1617-
"pk_multi_identity" => db_update.pk_multi_identity = pk_multi_identity_table::parse_table_update(table_update)?,
1618-
"player" => db_update.player = player_table::parse_table_update(table_update)?,
1619-
"points" => db_update.points = points_table::parse_table_update(table_update)?,
1620-
"private_table" => db_update.private_table = private_table_table::parse_table_update(table_update)?,
1621-
"repeating_test_arg" => db_update.repeating_test_arg = repeating_test_arg_table::parse_table_update(table_update)?,
1622-
"test_a" => db_update.test_a = test_a_table::parse_table_update(table_update)?,
1623-
"test_d" => db_update.test_d = test_d_table::parse_table_update(table_update)?,
1624-
"test_e" => db_update.test_e = test_e_table::parse_table_update(table_update)?,
1625-
"test_f" => db_update.test_f = test_f_table::parse_table_update(table_update)?,
1614+
"has_special_stuff" => db_update.has_special_stuff.append(has_special_stuff_table::parse_table_update(table_update)?),
1615+
"logged_out_player" => db_update.logged_out_player.append(logged_out_player_table::parse_table_update(table_update)?),
1616+
"person" => db_update.person.append(person_table::parse_table_update(table_update)?),
1617+
"pk_multi_identity" => db_update.pk_multi_identity.append(pk_multi_identity_table::parse_table_update(table_update)?),
1618+
"player" => db_update.player.append(player_table::parse_table_update(table_update)?),
1619+
"points" => db_update.points.append(points_table::parse_table_update(table_update)?),
1620+
"private_table" => db_update.private_table.append(private_table_table::parse_table_update(table_update)?),
1621+
"repeating_test_arg" => db_update.repeating_test_arg.append(repeating_test_arg_table::parse_table_update(table_update)?),
1622+
"test_a" => db_update.test_a.append(test_a_table::parse_table_update(table_update)?),
1623+
"test_d" => db_update.test_d.append(test_d_table::parse_table_update(table_update)?),
1624+
"test_e" => db_update.test_e.append(test_e_table::parse_table_update(table_update)?),
1625+
"test_f" => db_update.test_f.append(test_f_table::parse_table_update(table_update)?),
16261626

16271627
unknown => {
16281628
return Err(__sdk::InternalError::unknown_name(

crates/sdk/examples/quickstart-chat/module_bindings/identity_connected_reducer.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sdk/examples/quickstart-chat/module_bindings/identity_disconnected_reducer.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sdk/examples/quickstart-chat/module_bindings/message_table.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sdk/examples/quickstart-chat/module_bindings/message_type.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sdk/examples/quickstart-chat/module_bindings/mod.rs

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sdk/examples/quickstart-chat/module_bindings/send_message_reducer.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sdk/examples/quickstart-chat/module_bindings/set_name_reducer.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sdk/examples/quickstart-chat/module_bindings/user_table.rs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)