-
Notifications
You must be signed in to change notification settings - Fork 664
connect/disconnect reducers called when executing reducer from from CLI #334
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
Conversation
| let result = if let Err(e) = module.call_identity_connected_disconnected(caller_identity, true).await { | ||
| return Err((StatusCode::NOT_FOUND, format!("{:#}", anyhow::anyhow!(e))).into()); | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if/else chain is kinda grody, and I don't think it's necessary. Can this be:
if let Err(e) = module.call_identity_connected_disconnected(caller_identity, true).await {
// handle error
}
let result = match module.call_reducer(whatever).await {
// whatever
};It also seems like the if let Err(e) = foo { return Err(whatever); } could be made into a helper function, something like:
fn with_status_code(code: StatusCode, err: impl std::string::ToString) -> impl Axum::IntoResponse {
(code, err.to_string())
}
// handling an error
let result = module.call_reducer(caller_identity, None, &reducer, args)
.map_err(|e| with_status_code(StatusCode::NOT_FOUND, e)?;| } | ||
| }; | ||
| } | ||
| Err(e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call disconnected somewhere in this block?
Why were these here? I did some spelunking, and they were originally added in #334 , without any apparent discussion or justification.
* Some wording changes to the required unity versions we've had a few people utilize Unity 2021.2, but have a lot of errors/issues in the console. It's best to direct users to 2022.3.32f1 onward. * Removed recommended verbiage
## Description of Changes Missed in clockworklabs/com.clockworklabs.spacetimedbsdk#333. We should update the 1.2.1 tag and the `release/latest` branch after this. ## API - [ ] This is an API breaking change to the SDK Nope ## Requires SpacetimeDB PRs None ## Testsuite SpacetimeDB branch name: master ## Testing CI only Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
## Description of Changes Missed in clockworklabs/com.clockworklabs.spacetimedbsdk#333. We should update the 1.2.1 tag and the `release/latest` branch after this. ## API - [ ] This is an API breaking change to the SDK Nope ## Requires SpacetimeDB PRs None ## Testsuite SpacetimeDB branch name: master ## Testing CI only Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Description of Changes
API and ABI
If the API is breaking, please state below what will break