Shipment transition callbacks being skipped #4619
skukx
started this conversation in
New Features or Ideas
Replies: 1 comment
-
This is a can of worms. We explicitly don't run the Shipment state machine, and rather determine the shipment's state by its attributes for performance and complexity reasons (the order and shipment state machine interact in strange ways). You're right in that we should do one of two things: Either remove the shipment state machine entirely, or actually use it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Assume the below setup:
After an order is completed,
Spree::Order#finalize!
gets called.See
solidus/core/app/models/spree/order.rb
Lines 409 to 412 in 86501e4
If the order is paid for then these shipments will be updated to
ready
. The problem is that this update skips callbacks soSpree::Shipment#my_method
will not be called even though the shipment has transitioned to a state ofready
.Expected behavior would be that when the order moved to
complete
and updates the shipments. Each shipment that is updated to another state will create a transition event for that state change.Solidus 2.2
Happens in Core Solidus
See #2065 for specs recreating behavior
Beta Was this translation helpful? Give feedback.
All reactions