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

If a harvest fails to save because of a validation, side effects still happen #672

Open
atruskie opened this issue Apr 4, 2024 · 0 comments

Comments

@atruskie
Copy link
Member

atruskie commented Apr 4, 2024

With an invalid mapping:

  1. you hit finish
  2. state machine started changing
  3. sftp connection was deleted
  4. password and user removed from model
  5. model attempted tbe saved with status: scanning and password: null and username: null
  6. model save failed because of the validation
  7. connection is still deleted but the other changes were rolled back

Now the harvest can't continue, and the sftp connection is not available even though the model suggests it should be.

Possible solutions:

  • recreate the connection on state machine transition failure
  • check the connection is open when we think it's open (didn't we already have code for this?)

Kinda: https://github.com/QutEcoacoustics/baw-server/blob/40eb8002c1d10632b132b86b6fa94547ed637945/app/controllers/harvests_controller.rb#L36C14-L36C49 but it shortcuts it because we're less than two weeks

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

No branches or pull requests

1 participant