Stop preconditions from being executed twice#130
Merged
lstrzebinczyk merged 1 commit intomasterfrom Aug 29, 2024
Merged
Conversation
a1c92ed to
b163b33
Compare
lstrzebinczyk
commented
Aug 23, 2024
Contributor
Author
|
@toptal-anvil ping reviewers |
catks
reviewed
Aug 23, 2024
spec/spec_helper.rb
Outdated
| require 'simplecov' | ||
| SimpleCov.start do | ||
| minimum_coverage 99.66 | ||
| minimum_coverage 99.43 |
Member
There was a problem hiding this comment.
I think it would be good to add a new spec to ensure the preconditions are only called once, I think you can call a spy/mock in
mbie
reviewed
Aug 26, 2024
Contributor
Author
|
@toptal-anvil ping reviewers |
Contributor
Author
|
@toptal-anvil ping reviewers |
mbie
approved these changes
Aug 26, 2024
catks
approved these changes
Aug 26, 2024
60a1cb5 to
3fce264
Compare
Contributor
Author
|
I've converted to draft to hide from seal. I'll get back to this once I have a moment, or after oncall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running an action with
#try_perform!, preconditions are being run twice. This PR fixes this.https://github.com/toptal/platform/pull/78833 is a platform PR run against this patch, with successfull unit tests and features:
How to test
TestAction.as_system.new(RoleStep.new).try_perform!RUNNING PRECONDITIONtwiceReview
Pre-merge checklist
master(if not - rebase it).