- Issue created by @bradjones1
- πΊπΈUnited States bradjones1 Digital Nomad Life
I need to check out for the weekend but I think this sums up well the underlying issue of an unsaved order item being saved during order save.
It might be that this is in fact just unsupported in commerce. If that's so, we should detect this condition early and throw an exception, because otherwise this 1) requires developers to magically know they can't rely on functionality that otherwise "just works" in Entity API without breaking those contracts and 2) results in broken order data (namely, the total) in a rather undeterministic manner.
This is covered in π Saving an order with unsaved order items results in tough-to-debug data inconsistency Active so I'll put more discussion there. For recurring, the question is whether we accept this bug is really in Commerce Order and work around it here? Probably. That would mean keeping the workaround in place, updating it with a reference here, and then acting accordingly in the recurring ecosystem.
- πΊπΈUnited States bradjones1 Digital Nomad Life
Test coverage was incorrect to begin with, I think... and this is postponed on π Saving an order with unsaved order items results in tough-to-debug data inconsistency Active in Commerce core which allows us to back out the work-around in recurring.