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

Inject logs into module on failure to invoke reducer #98

Merged
merged 3 commits into from
Jul 26, 2023
Merged

Conversation

kazimuth
Copy link
Contributor

Description of Changes

Addresses https://www.notion.so/clockworklabs/Print-in-module-logs-when-calling-a-reducer-with-wrong-arguments-8a25d6dd90be443d92d848bbca7c1862
Took me a few days to figure out the plumbing, but once I got it it was quite simple.

This produces logs like so:

$ spacetime logs 93dda09db9a56d8fa6c024d843e805d8
 INFO: src\lib.rs:11: initiating
ERROR: external: External attempt to call reducer "add" failed, invalid arguments.
This is likely due to a mismatched client schema, have you run `spacetime generate` recently?

Side comments

While testing, I was using a small generated Rust client module. Should I check that in as a test? I noticed there aren't currently any generated Rust clients in test/, not sure if we're keeping that out of the test surface for now.

I also noticed that the Rust client SDK mostly silently swallows errors. E.g. a reducer called from out-of-date generated client code doesn't produce an error, also attempting to iterate a table with an out-of-date generated schema silently fails and iterates nothing. There is a little bit of stuff in the logs though if you configure a logger. I guess I should create separate issues for these problems?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants