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

Context.fail! error message gets pupulated 3 times with the same message #184

Closed
majksner opened this issue Feb 11, 2020 · 2 comments · Fixed by #188
Closed

Context.fail! error message gets pupulated 3 times with the same message #184

majksner opened this issue Feb 11, 2020 · 2 comments · Fixed by #188
Labels
bug Something isn't working verified This issue has been verified.
Milestone

Comments

@majksner
Copy link

If interactor within organizer fails, messages and details get populated 3 items with the same message.

 @details={:context=>[{:error=>"Invalid value for eu_vat."}, {:error=>"Invalid value for eu_vat."}, {:error=>"Invalid value for eu_vat."}]},
 @messages={:context=>["Invalid value for eu_vat.", "Invalid value for eu_vat.", "Invalid value for eu_vat."]}

You can use code from #169 to reproduce the issue.

Thanks,

@majksner majksner added bug Something isn't working unverified This issue has not been verified labels Feb 11, 2020
@majksner majksner changed the title Context.fail! error message gets pupulated n times in messages Context.fail! error message gets pupulated 3 times with the same message Feb 11, 2020
@aaronmallen aaronmallen added verified This issue has been verified. context and removed unverified This issue has not been verified labels Feb 11, 2020
@aaronmallen aaronmallen added this to the v1.0.4 milestone Feb 11, 2020
aaronmallen added a commit that referenced this issue Feb 11, 2020
@aaronmallen
Copy link
Owner

@majksner can you add the following to your gemfile:

git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'activeinteractor', require: 'active_interactor', github: 'aaronmallen/activeinteractor', branch: 'bugfix/#184'

and tell me if you're able to reproduce this issue?

@majksner
Copy link
Author

Looks good,

[1] pry(main)> result = TestInteractor::Test.perform()
=> #<TestInteractor::Test::Context>
[2] pry(main)> result.errors
=> #<ActiveModel::Errors:0x00007f957067a6a8
 @base=#<TestInteractor::Test::Context>,
 @details={:context=>[{:error=>"Something Went Wrong in Prepare"}]},
 @messages={:context=>["Something Went Wrong in Prepare"]}>

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

Successfully merging a pull request may close this issue.

2 participants