Skip to content

Fix: {LineItem;Shipment}#total_before_tax: Ignore stale adjustments - #6521

Open
mamhoff wants to merge 1 commit into
solidusio:mainfrom
mamhoff:exclude-marked-for-destruction-adjustments
Open

Fix: {LineItem;Shipment}#total_before_tax: Ignore stale adjustments#6521
mamhoff wants to merge 1 commit into
solidusio:mainfrom
mamhoff:exclude-marked-for-destruction-adjustments

Conversation

@mamhoff

@mamhoff mamhoff commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

SolidusPromotions will mark adjustments for destruction if they no longer apply (especially if there are two adjustments from promotions from the same lane). With unpersisted orders, this can lead to #total_before_tax on line items and shipments to count those stale adjustments.

The fix is to always exclude adjustments that are marked for destruction.

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.

SolidusPromotions will mark adjustments for destruction if they no
longer apply (especially if there are two adjustments from promotions
from the same lane). With unpersisted orders, this can lead to
`#total_before_tax` on line items and shipments to count those stale
adjustments.

The fix is to always exclude adjustments that are marked for
destruction.
@mamhoff
mamhoff requested a review from a team as a code owner July 28, 2026 09:03
@github-actions github-actions Bot added the changelog:solidus_core Changes to the solidus_core gem label Jul 28, 2026
@mamhoff mamhoff added backport-v4.7 Backport this pull-request to v4.7 type:bug Error, flaw or fault and removed changelog:solidus_core Changes to the solidus_core gem labels Jul 28, 2026
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.51%. Comparing base (cdcdfaf) to head (8ab4683).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6521   +/-   ##
=======================================
  Coverage   91.51%   91.51%           
=======================================
  Files         839      839           
  Lines       18057    18057           
=======================================
  Hits        16525    16525           
  Misses       1532     1532           

☔ View full report in Codecov by Harness.
📢 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.

@tvdeyen tvdeyen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes much sense

@tvdeyen

tvdeyen commented Jul 28, 2026

Copy link
Copy Markdown
Member

Test failures in solidus admin are unrelated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v4.7 Backport this pull-request to v4.7 type:bug Error, flaw or fault

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants