Skip to content
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

Remove support for the update reducer #1557

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Remove support for the update reducer #1557

merged 1 commit into from
Jul 31, 2024

Conversation

kim
Copy link
Contributor

@kim kim commented Jul 30, 2024

Remove support for the update reducer

In favor of migrations providing similar and more powerful functionality.
Also remove traces of the migrate reducer, for the same reasons.

API and ABI breaking changes

Modules using #[spacetimedb(update)] will no longer compile.

Expected complexity and risk

2

Testing

Should work as before.

In favor of migrations providing similar and more powerful
functionality.

Also remove traces of the `migrate` reducer, for the same reasons.
@kim kim force-pushed the kim/remove-update branch from 1e13bbf to bb260a9 Compare July 30, 2024 11:02
@kim kim added the abi-break A PR that makes an ABI breaking change label Jul 30, 2024
@kim kim requested review from gefjon, Centril and cloutiertyler July 30, 2024 11:05
@kim kim marked this pull request as ready for review July 30, 2024 11:05
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor suggestions for a follow up, this PR, or to ignore if you like.

Comment on lines +599 to +607
let res = if stored == program.hash {
info!("database `{}` up to date with program `{}`", addr, program.hash);
Ok(())
} else {
info!("updating `{}` from {} to {}", addr, stored, program.hash);
module.update_database(program.hash, program.bytes).await?
};

Ok(res)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let res = if stored == program.hash {
info!("database `{}` up to date with program `{}`", addr, program.hash);
Ok(())
} else {
info!("updating `{}` from {} to {}", addr, stored, program.hash);
module.update_database(program.hash, program.bytes).await?
};
Ok(res)
Ok(if stored == program.hash {
info!("database `{}` up to date with program `{}`", addr, program.hash);
Ok(())
} else {
info!("updating `{}` from {} to {}", addr, stored, program.hash);
module.update_database(program.hash, program.bytes).await?
})

@kim kim added this pull request to the merge queue Jul 31, 2024
Merged via the queue into master with commit 4ffeff7 Jul 31, 2024
9 checks passed
@kim kim deleted the kim/remove-update branch July 31, 2024 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abi-break A PR that makes an ABI breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove module update functionality in favor of future migration/publish argument implementation
3 participants