clockworklabs / clockworklabs/SpacetimeDB

C# and Rust modules have different server-side reducer names

Open
#2,165 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

Noticed this while playing with Blackholio.

Swapping between the C# and Rust versions of the modules, the generated code is ALMOST identical. In the C# client code, the user can always call reducers like .EnterGame() and have it work.

The difference is that, if the C# version of the module is used, under the hood, .EnterGame() sends a message containing the string "EnterGame". On the other hand, if the Rust version of the module is used, under the hood, .EnterGame() send a message containing the string "enter_game". This means that the user needs to regenerate client code when swapping between the modules, despite there not being any user-facing API changes.

If we want to fix this, we could canonicalize reducer names in a module to either a snake_case or a CamelCase convention.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reproducing the Blackholio module swap and comparing the reducer strings emitted by the C# and Rust versions; done means choosing and applying one canonical reducer naming convention so regenerated client code is not required when switching modules.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, rust
Domain
api, backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.