-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix updating the order state after returning items
The problem was a composite of many problems which, hopefully, are now fixed. The first one was that order.inventory_units was memoized with completely different instances from ReturnItem#inventory_unit. So the check to see if they were all returned was, at times, ineffective. The second part is that the state_machines library can halt callback chains without telling anything to anyone. That was happening in some cases when ReturnItem#attempt_accept was failing. In those cases, just to increase confusion, the acceptance state-machine was interfering with the reception state-machine. The third part is that the introduction of the accessor for skip_customer_return_processing was fixing one code path (the one still visible in the original PR) but was disrupting another one, namely marking the order as returned after the return-item state- machine was getting the "receive" event.
- Loading branch information
Showing
4 changed files
with
61 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters