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

Success state sometimes not run #102

Open
isidornygren opened this issue Jul 25, 2024 · 1 comment
Open

Success state sometimes not run #102

isidornygren opened this issue Jul 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@isidornygren
Copy link

isidornygren commented Jul 25, 2024

Hello and thanks for an amazing library. I'm running into an issue when using a Success | Failure matcher for action cleanup:

   ...
   ActionState::Cancelled => {
      *state = ActionState::Failure;
   }
   ActionState::Failure | ActionState::Success => {
      commands.entity(*actor).remove::<SomeMarker>();
   }

Which I assumed would run if the action failed or successfully completed at any point. However, after doing some test runs I can see that an action can successfully complete without running the cleanup routine sometimes, but I'm not sure why. I'll investigate a bit on my end and report if I find any further clues.

@zkat zkat added the bug Something isn't working label Jul 25, 2024
@zkat
Copy link
Owner

zkat commented Jul 25, 2024

I'm pretty sure this is an oversight, but it's been a while. It seems pretty reasonable to me to expect either Failure or Success to always run at least once. I'll totally take a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants