Hey all, wondering if anyone is familiar enough wi...
# support
z
Hey all, wondering if anyone is familiar enough with the
solidus_shipstation
gem, to know why the pending-shipments query scopes on the parent
spree_order.updated_at
field , instead of on the
spree_shipement.updated_at
?
it seems like there are situations where the shipment could be updated without the parent order being updated. ….but is the notion that those situations should
touch
the parent, given some condition?
I’ve consider that the current design may also be to prevent a loop with an external integration [to that shipment] — i.e. from updating the shipment on a callback, causing its
updated_at
date to change, triggering it to sync, updating the external record, which maybe again triggers a callback to update it in solidus
But i thought I’d ask. Can post it as a GH issue, if preferred
w
I guess that’s because orders can have multiple shipments, and given an update on shipments is supposed to always touch the order, that’s the best heuristic we can have. For more context, this is the commit that introduced that condition. cc @alessandro
a
@Zachary Jones it’s been a long time since I made that commit, but if I had to guess, I would say it’s because some of the data you sync with ShipStation (e.g., the billing/shipping address) lives on the order, not on the shipment. If you update it, you want to make sure all of your shipments are re-synced.
👍 1
z
Thanks, both. I’d overlooked this commit you mentioned @waiting_for_dev, and (in classic form?) i think it tells me exactly what I should consider next: that in our system somewhere we are doing an update to the shipment that bypasses the callback. So, the order doesn’t get touched, and the re-sync to shipstation isn’t triggered
Or that’s first glance
to be clear - i definitely think the condition to sync-on-order-update should remain. My focus here was whether any individual shipment update should also trigger re-sync, regardless of whether the order also updated — meaning, if the shipment->touch->order link was bypassed