Currently, the AvailabilityOrderProcessor performs a loop on order items, and call removeItem()right from the loop. I generally prefer to avoid removing array items from an array I'm looping on and I'm currently suspecting this to cause issues.

Additionally, I'd suggest collecting the order item IDS to delete and pass it to the storage so we delete multiple order items at once (Patch to follow).

Comments

jsacksick created an issue. See original summary.

jsacksick’s picture

Status: Active » Needs review
StatusFileSize
new3.23 KB

Also, removeItem() calls recalculateTotalPrice() which means if 5 items are removed by the availability order processor, the order total will be recalculated 5 times, so besides fixing eventual errors, that patch should also improve performance when more than one item is removed because it's unavailable.

Weirdly, it seems we don't have any test for the availability order processor, so we might have to add that too.

jsacksick’s picture

Issue tags: +Needs tests
jsacksick’s picture

StatusFileSize
new3.27 KB

The last submitted patch, 2: 3127569-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 4: 3127569-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jsacksick’s picture

Status: Needs work » Needs review
StatusFileSize
new3.27 KB

Status: Needs review » Needs work

The last submitted patch, 7: 3127569-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jsacksick’s picture

Status: Needs work » Needs review
StatusFileSize
new3.27 KB
jsacksick’s picture

StatusFileSize
new3.27 KB

  • jsacksick committed 84f825c on 8.x-2.x
    Issue #3127569 by jsacksick: Performance improvements to...
jsacksick’s picture

Status: Needs review » Fixed
Issue tags: -Needs tests

Committed a slightly different patch, and it turns out we already have tests coverage, so didn't add any.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.