Draft Order line items not reflected in UI after changes

Hi,

We are adding a draft order ui-extension block to our app which provides the ability for a user to add some products that are related to items on the draft order. For example, you can add a snowboard to the order, and then the user is presented with the app block to show some specific products they can add to the draft order.

One of the issues that we’re finding is that after using the draftOrderUpdate, the order line items are not updated automatically. The user has to manually refresh the page for the changes to be reflected. We have also attempted to initiate the “Save” bar at the top after our app block makes some changes, but even that won’t reflect the newly added line items.

This works differently from the main order detail page where changes to the order are reflected. Is this something that can be updated on the draft order page? This ultimately causes a poor user experience if app blocks are adding/editing line items on the draft order.

This is likely related to this topic:

Regards,
Ben

Hi Ben. We’re looking into this now. Thanks!

3 Likes

Ben - This should now be fixed. Let me know if you’re still seeing issues.

Hey @Mitch_Lillie! I’m testing this on our end and I’m not seeing any difference. What behavior has changed on your end? Possible something just hasn’t rolled out yet?

Specifically our flow is Admin UI block → opens Admin UI action and makes a direct API call to shopify graphQL that adds/updates an order item. We’re hoping that the Draft Order products would automatically update without us having to refresh. I’m still having to refresh to see any updates.

Thanks so much for the help!

Tried this again today and notice that the UI is automatically updating when line items are added or removed! :tada:

Updating an existing line item by UUID, say quantity 1 → 2 doesn’t seem to update until a hard refresh but I will note that there’s no delay like there was previously in which you might have needed multiple hard refreshes. Was the intention for those cases to automatically update as wel

EDIT: I will note that changing the quantity (or product) isn’t reflecting in the UI until refresh BUT the subtotal/total are updating on the fly.

Some screenshots showing what we see, here is the state after adding our items with our Block/Action. The draft order is correctly updated with no reload:

Lets say they decide to use our block to update the Protection Plan to cover both Espresso Macines

Hitting that will then trigger a single draftOrderUpdate call (the same one used to add the items initially). The resulting state is:

Interestingly, you can see the Payment Section references 5 items. Our draft order block re-renders and the draft order pulled in also knows that the Extend Protection Plan quantity was updated to 2. You can see that the subtotal reflects an updated correct amount (though the tax does not recalculate).

If I then hard refresh at any point it becomes correct: