When an order checkout is completed, CheckoutFlowBase::submitForm() first does the workflow transitions, then throws the checkout complete event, and as very last step the order gets saved. This can cause transactional problems as well as the placed timestamp is not saved at the time the event subscribers are acting.
Discussed with bojanz today. This is clearly wrong. The order must be saved first, otherwise it isn't complete.
On the long run, the event will be dropped anyway, as the workflow transition should trigger an event by itself, which isn't the case now. So we'll need a fix for that in the meantime
Comments
Comment #2
bojanz commentedOpened #2788037: Remove the checkout complete event in favor of the workflow's placed event as a followup.
Comment #4
bojanz commentedImplemented the discussed fix.