solidus icon indicating copy to clipboard operation
solidus copied to clipboard

fix: update_shipped_shipments now cancels properly

Open NewAlexandria opened this issue 3 years ago • 4 comments

also refactor method parts for easier overwriting, in a way that also encourages the use of super for the main method

Description We were having this same issue, and I found the related issue when searching.

This solution may a fait bit more ruby algo gymnastics, but if it's acceptable I think it could make it easier to overwrite this pattern, again while still trying to encourage people to call super when overwriting the update_shipped_shipments method.

I also use an update_all call, to avoid N+1 queries.

I can include other comments, tests, etc, if this code looks like it'd be acceptable, and if anyone has suggestions. Until I confirmed receptiveness I didn't want to setup the test env. This PR is basically WIP, pending feedback.

Ref: https://github.com/solidusio/solidus/issues/2947

Checklist:

  • [x] I have followed Pull Request guidelines
  • [x] I have added a detailed description into each commit message
  • [x] I have updated Guides and README accordingly to this change (if needed)
  • [ ] I have added tests to cover this change (if needed)
  • [x] I have attached screenshots to this PR for visual changes (if needed)

NewAlexandria avatar Jul 12 '22 21:07 NewAlexandria

Hey @NewAlexandria, it looks like tests are failing. Would you like to keep working on it? :slightly_smiling_face:

waiting-for-dev avatar Aug 02 '22 11:08 waiting-for-dev

Hey @NewAlexandria, it looks like tests are failing. Would you like to keep working on it? 🙂

Sure, I'm glad to. As I mentioned in the PR body, I just wanted to make sure it seemed like a reasonable change that would be accepted given tests pass, etc.

I'll be slow to respond because we're pushing through to a launch, but I can commit to finishing this PR's tests, so it's mergeable

NewAlexandria avatar Aug 02 '22 18:08 NewAlexandria

Hey @NewAlexandria! Thanks for your contribution. Before evaluating the solution proposed (which looks good at a first pass), can you please add a failing spec for this bug to be sure this regression will never come back in the future? Thanks in advance!

kennyadsl avatar Aug 22 '22 08:08 kennyadsl

I will get back to this PR. We're just in the middle of a release. Thanks.

NewAlexandria avatar Sep 07 '22 19:09 NewAlexandria