DeliveryGroup in shopify functions not correct when single line item is split amongst multiple locations due to stock

When a single line item has been split across multiple locations due to stock, it is still grouped as a single delivery group when queried via shopify functions. in addition, split shipping does not kick in although this triggers multiple carrier service API calls.

For example if product A was stocked at location 1, location 2 and location 3, each at 1x unit.

A customer purchased 3x units, this will be fulfilled by 1 item from each location.

Carrier service correctly makes 3 separate calls for each location and 1x item, however the deliveryGroup grouping still has this as a single grouping. It should reflect 3 separate delivery groups.

I believe you just need to enable “Show split shipping in checkout” – keep in mind this will be visible to customers, not just functions.

I already have that enabled and does not correct the problem, even without split shipping enabled, the item is still split into multiple shipments with respect to calculating rates, and if split shipping is enabled the split doesn’t show correctly either (it doesn’t split at all). The same if each location has different rates in the shipping profile, or if all locations are set to the same set of rates.