-
Notifications
You must be signed in to change notification settings - Fork 212
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
Skip rollback for failed interactor #6
Conversation
Interactors should be single-purpose. An interactor should not affect its context until it's performed successfully. This eliminates the need for cleanup on failure. Only successfully performed interactors within an organizer will be rolled back.
To accomplish organizer rollback, we store instances rather than classes in the organizer's "performed" method so that "performed" for nested organizers is still intact and available.
Changes Unknown when pulling 7f91024 on skip-rollback-for-failed-interactor into * on master*. |
expect(interactor4c).not_to receive(:perform) | ||
expect(interactor5).not_to receive(:perform) | ||
|
||
expect(instance4a).to receive(:rollback).once.with(no_args).ordered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want an explicit not to receive :rollback expectation on instance4b?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no spoon instance4b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there should be.
Super! 👍 |
Changes Unknown when pulling d56618f on skip-rollback-for-failed-interactor into * on master*. |
🚦 💚 🙏 |
…teractor Skip rollback for failed interactor
This relates to #4 and also fixes a rollback bug for organizers within organizers.