On-publish hook for C# modules
We want an OnUpdate hook for C# modules. This hook will be called whenever the module is published.
Note: We may want to separately consider a rename of this hook, since it can be confusing for Unity users.
Ran into an issue testing a potential C# solution, in which the solution was not triggering the hook as expected. So because this was presumed to be implemented in the Rust modules, I attempted to reproduce the intended behavior in a Rust module, following the guidance provided in the Rust bindings documentation.
This Rust module creation was performed as-follows:
- Create new Rust module.
- Create an
initandupdatereducer. - Publish module.
- Change module code.
- Republish module.
- Check logs:
Reviewing the logs, we never see the update reducer get called, but we do see other log messages indicated the module update successfully occurred.
If we look to the code for where these log messages are being generated, we can see where the Init Lifecycle is checked/called using Lifecycle::Init, but in the update_database function, we don't see a Lifecycle::Update getting called. We do see the other log comments being generated, so this would be the anticipated place to see a call to the Update Lifecycle reducer.
I will be placing this issue as blocked until I can confirmation on next-steps.
Support for the update reducer was removed in https://github.com/clockworklabs/SpacetimeDB/pull/1557
The actions required by this issue have changed in scope, from just implementing update lifecycle reducer in the C# SDK, to reintroducing the feature to the core for SpacetimeDB.
Because support was removed, the next step will be going through existing public documentation to ensure we have no references to a lifecycle reducer called "update", tracking this cleanup effort in https://github.com/clockworklabs/spacetime-docs/issues/267.