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

Gracefully handle invalid state #6240

Closed

Conversation

DogPawHat
Copy link
Contributor

Current behavior

Per #5633:

Currently, ockam_command expects its state to be valid, and if it's not - it panics here

Proposed changes

Currently WIP

I've moved the delete function for StateItemTrait to a separate StateItemFileTrait, because all StateItemTraits have a config that needs to be serialized by serde. If deserialization fails, there's no way to delete the file in a reset as the trait is all or nothing and you can't call delete in say ockam reset down the line.

Checks

  • All commits in this Pull Request are signed and Verified by Github.
  • All commits in this Pull Request follow the Ockam commit message convention.
  • There are no Merge commits in this Pull Request. Ockam repo maintains a linear commit history. We merge Pull Requests by rebasing them onto the develop branch. Rebasing to the latest develop branch and force pushing to your Pull Request branch is okay.
  • I have read and accept the Ockam Community Code of Conduct.
  • I have read and accepted the Ockam Contributor License Agreement by adding my Git/Github details in a row at the end of the CONTRIBUTORS.csv file in a separate pull request to the build-trust/ockam repository. The easiest way to do this is to edit the CONTRIBUTORS.csv file in the github web UI and create a separate Pull Request, this will mark the commit as verified.

Created, implemented `StateItemFileTrait`
Created, implemented `CliState::InvalidFile`
Update `StateItemTrait` with `StateItemFileTrait` imports
@mrinalwadhwa mrinalwadhwa added the hacktoberfest Apply to issues you want contributors to help with label Oct 3, 2023
@adrianbenavides adrianbenavides added the HACKTOBERFEST-ACCEPTED To be used when a PR is ready to merge or after it's merged label Oct 4, 2023
@adrianbenavides
Copy link
Member

@DogPawHat As explained in the issue I'm closing this PR as it was recently fixed, but I'll add the HACKTOBERFEST-ACCEPTED label in case you are participating in the event!

Thank you so much for the time you spent on this PR and I hope you can find other issues that may suit your interests 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Apply to issues you want contributors to help with HACKTOBERFEST-ACCEPTED To be used when a PR is ready to merge or after it's merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants