-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hotswapping modules (No longer working in 0.12) #1807
Comments
I will try to repro this; I doubt I am the right person to actually fix the issue. |
A minimal test of hotswapping has worked for me:
|
Reassigning to keep investigating. We have a repro using clockworklabs/SpacetimeDBCircleGame#2; specifically, by switching the food count and trying to re-publish the module.. but it's unclear why it's failing, and attempting a more minimal repro does not work. |
This is the smallest repro I could come up with. Module code: use spacetimedb::{ReducerContext, SpacetimeType, Table};
#[spacetimedb::table(name = entity, public)]
pub struct Entity {
pub position: Vector2,
}
#[derive(SpacetimeType, Debug, Clone, Copy)]
pub struct Vector2 {
pub x: f32,
pub y: f32,
}
#[spacetimedb::reducer]
pub fn spawn_food(ctx: &ReducerContext) -> Result<(), String> {
let count = ctx.db.entity().count();
if count < 600 as u64 {
ctx.db.entity().try_insert(Entity {
position: Vector2 { x: 0.0, y: 0.0 },
})?;
}
Ok(())
} And repro process: echo "Publishing.."
spacetime publish -s local circle-test --delete-data --yes
echo "Updating count.."
sed -i'' 's/\<600\>/6000/' src/lib.rs
echo "Republishing.."
spacetime publish -s local circle-test
echo "Reverting count.."
sed -i'' 's/\<6000\>/600/' src/lib.rs |
This ended up being a schema issue which is fixed now in: #1813 |
No description provided.
The text was updated successfully, but these errors were encountered: