Skip to content

Resolve regression in OrderUpdater#log_state_change - #6318

Merged
tvdeyen merged 2 commits into
solidusio:mainfrom
SuperGoodSoft:order-updater-state-change-regression
Sep 5, 2025
Merged

Resolve regression in OrderUpdater#log_state_change#6318
tvdeyen merged 2 commits into
solidusio:mainfrom
SuperGoodSoft:order-updater-state-change-regression

Conversation

@benjaminwil

Copy link
Copy Markdown
Contributor

Summary

When we merged #6304, we inadvertently changed the behaviour of Spree::OrderUpdater#log_state_change, which used to log state changes with a name "payment" or "shipment" but now only logs state changes with the name "order".

Checklist

@benjaminwil
benjaminwil requested a review from a team as a code owner August 15, 2025 18:36
@github-actions github-actions Bot added the changelog:solidus_core Changes to the solidus_core gem label Aug 15, 2025
@benjaminwil
benjaminwil force-pushed the order-updater-state-change-regression branch from bcde800 to 0239bfe Compare August 15, 2025 18:45
@codecov

codecov Bot commented Aug 15, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.34%. Comparing base (12f00d6) to head (c0adc92).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6318   +/-   ##
=======================================
  Coverage   89.34%   89.34%           
=======================================
  Files         961      961           
  Lines       20161    20161           
=======================================
  Hits        18012    18012           
  Misses       2149     2149           

☔ 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.

@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.

Thanks

@benjaminwil
benjaminwil force-pushed the order-updater-state-change-regression branch from 0239bfe to 3a709e9 Compare August 15, 2025 20:46
When the new asynchronous state change logging job was introduced in
\solidusio#6304, the attributes saved to `spree_state_change` records was
inadvertently changed to exclude the name of the model whose state was
being changed.

For example, when the order updater calls `log_state_change("payment")`,
the state change record would have the name "payment" on it. Since the
job was introduced all of the state change records created by the order
updater would have a name "order".

This commit simply exposes the change in behaviour so we can understand
and resolve the issue more clearly.

Co-Authored-By: Adam Mueller <adam@super.gd>
@benjaminwil
benjaminwil force-pushed the order-updater-state-change-regression branch from 3a709e9 to fe72d65 Compare August 15, 2025 20:47
@benjaminwil

Copy link
Copy Markdown
Contributor Author

Just realized the first commit was doing more than it said it was doing. I've rebased to ensure that the first commit only exposes the issue and the second commit does the fixing.

Whenever `Spree::OrderUpdater#log_state_change` was called, all state
change records created would have a state change name of "order". This
is a change in behaviour from Solidus historically and was inadvertently
changed when we merged solidusio#6304.

Co-Authored-By: Adam Mueller <adam@super.gd>
@benjaminwil
benjaminwil force-pushed the order-updater-state-change-regression branch from fe72d65 to c0adc92 Compare August 15, 2025 20:52
@tvdeyen tvdeyen added this to the 4.6 milestone Sep 5, 2025
@tvdeyen
tvdeyen merged commit 3610f90 into solidusio:main Sep 5, 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

Development

Successfully merging this pull request may close these issues.

3 participants