Order Item media is not awaited before additional order item transformations #6535
Labels
bug
For issues that describe a defect or regression in the released software
needs triage
For issues that are awaiting triage by the core development team
Issue Description
When querying an order from MOC, the resolver for the items in the order tries to evaluate the image URLs:
reaction/packages/api-plugin-orders/src/xforms/xformOrderItems.js
Line 11 in 490a5c1
After that, the orders plugin calls all functions of type
xformOrderItems
to apply additional transformations to the order items.None of the stock plugins actually modify those order items and the whole property resolves correctly.
A problem might arise when a custom plugin tries to mutate the order items because they are not awaited and instead of a list of order items, the orders plugin passes a Promise of the array.
Steps to Reproduce
xformOrderItems
and tries to modify the passed property of order itemsPossible Solution
Await the initial order items before passing them to the
xformOrderItems
functionsThe text was updated successfully, but these errors were encountered: