Skip to content

Conversation

@mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Nov 17, 2025

Summary

This inverse_of gives rise to spurious adjustments appearing in the database if there are newly built and directly marked for destruction.

Since we're never calling adjustment.order anywhere in production code, I am pretty sure we can remove this inverse_of safely.

I believe what happens is that the adjustment gets added to order.all_adjustments on initialization, and marking it for destruction on the shipment does not carry on to that association as it does not have the autosave property.

Alternatively, we could add autosave to order.all_adjustments, but that could surface even weirder bugs.

Found while building #6371

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

This `inverse_of` gives rise to spurious adjustments appearing in the
database if there are newly built and directly marked for destruction.

Since we're never calling `adjustment.order` anywhere in production
code, I am pretty sure we can remove this inverse_of safely.

I believe what happens is that the adjustment gets added to
`order.all_adjustments` on initialization, and marking it for
destruction on the shipment does not carry on to that association as it
does not have the `autosave` property.

Alternatively, we could add `autosave` to `order.all_adjustments`, but
that could surface even weirder bugs.
@mamhoff mamhoff requested a review from a team as a code owner November 17, 2025 23:14
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Nov 17, 2025
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.44%. Comparing base (143f09a) to head (7ac8007).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6373   +/-   ##
=======================================
  Coverage   89.44%   89.44%           
=======================================
  Files         973      973           
  Lines       20298    20298           
=======================================
  Hits        18156    18156           
  Misses       2142     2142           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mamhoff mamhoff merged commit f08a1ba into solidusio:main Nov 19, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:solidus_core Changes to the solidus_core gem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants