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

Should we make it a best practice to always surround mutations in a try catch? We need to ensure we never get into an inconsistent state #42

Open
lastmjs opened this issue Apr 25, 2022 · 0 comments

Comments

@lastmjs
Copy link
Member

lastmjs commented Apr 25, 2022

Should we make it a best practice to always surround mutations in a try catch? We need to ensure we never get into an inconsistent state?

Canisters need to be very careful when trapping, and I believe when an error is thrown in Boa then the canister will panic thus causing a trap. This could lead to inconsistent behavior if there have a been any cross-canister calls, as the state before the call will have been committed but not the state after the call.

For now I am doing all mutations after any cross-canister calls, so any uncaught errors should wipe clean, but we should be aware of this and possibly come up with best practices.

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

No branches or pull requests

1 participant