Skip to content

Skip deferred callbacks for skipped Interactors#8

Merged
mjonas87 merged 1 commit intoforked-mainfrom
fix-conditionally-organized-callbacks
Apr 1, 2024
Merged

Skip deferred callbacks for skipped Interactors#8
mjonas87 merged 1 commit intoforked-mainfrom
fix-conditionally-organized-callbacks

Conversation

@mjonas87
Copy link

Description

In an Organizer, skip an Interactor's callbacks if the Interactor is skipped

Previously, if a deferred Interactor had a conditional (ie; if or unless) attached to it, it's deferred after_perform callbacks were NOT skipped. This is because when using deferment...an Organizer assumes responsibility for executing the after_perform callbacks. When I implemented the Organizer logic that runs the deferred after_perform callbacks, I failed to account for conditionals.

This commit passes the calling Organizer in with the call to execute the deferred after_perform callbacks. This is used to check the conditional and see if the callback should be run or skipped. Now, if an Interactor is skipped, it's deferred after_perform callbacks will be too.

Information

  • [ ] Contains Documentation
  • Contains Tests
  • [ ] Contains Breaking Changes

@mjonas87 mjonas87 changed the title In an Organizer, skip an Interactor's callbacks if the Interactor is … Skip deferred callbacks for skipped Interactors Mar 26, 2024
…skipped

Previously, if a deferred Interactor had a conditional (ie; if or unless) attached to it, it's deferred after_perform callbacks were NOT skipped. This is because when using deferment...an Organizer assumes responsibility for executing the after_perform callbacks. When I implemented the Organizer logic that runs the deferred after_perform callbacks, I failed to account for conditionals.

This commit passes the calling Organizer in with the call to execute the deferred after_perform callbacks. This is used to check the conditional and see if the callback should be run or skipped. Now, if an Interactor is skipped, it's deferred after_perform callbacks will be too.
@mjonas87 mjonas87 force-pushed the fix-conditionally-organized-callbacks branch from ecb74a4 to 7d2e4a6 Compare March 28, 2024 01:15
@mjonas87 mjonas87 merged commit 55f0521 into forked-main Apr 1, 2024
@mjonas87 mjonas87 deleted the fix-conditionally-organized-callbacks branch April 1, 2024 18:15
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.

1 participant