reaction icon indicating copy to clipboard operation
reaction copied to clipboard

cancelOrderItem can't deal with concurrent requests properly

Open janus-reith opened this issue 4 years ago • 16 comments

Issue Description

If cancelOrderItem is fired in parallel for multiple fulfillment groups of an order, only some of them might receive an update. You can see this in action on the current order admin, which fires them in parallel if you click "Cancel Order" (Might be reconsidered in general, network errors should not result in an order being partially cancelled.)

Steps to Reproduce

  1. Create an order with two fulfillment groups
  2. Click "Cancel order" in the admin
  3. Notice that only one of the fulfillment groups updated their status

Possible Solution

The reason for this is that the mutation will process the whole shipping array of an order in memory and write that to the db - Parallel updates to it will get lost. Options could either be to add some locking mechanism on this, or to just to rewrite this to make atomic operations instead of replacing the whole array.

Versions

latest

janus-reith avatar Jan 20 '21 11:01 janus-reith

Hi @zenweasel , are planning to implement this. If yes I am interested to work on it.

chethan27 avatar Nov 07 '22 14:11 chethan27

@chethan27 sorry for the late reply. If you would like to work on this please do. Reach out if you need any help

brent-hoover avatar Nov 11 '22 00:11 brent-hoover

I am beginner and want to contribute to this project, can you guide me from where should I start?

lokeshuc avatar Apr 25 '23 04:04 lokeshuc

@lokeshuc Thanks for the contribution.

I think you have the required details in the readme of the reaction repo to get you started. You could check this. Also please check the contribution guide here where you are ready for PR.

I quickly checked if the mutation mentioned above is impacted by the changes in the upcoming release, and it is not.

Please note, the reporter of the issue has provided the steps to reproduce as cancelling the order from admin console which is a separate repo here.

sujithvn avatar Apr 25 '23 13:04 sujithvn

@sujithvn Thanks for the reply ,I will surely check the required details

lokeshuc avatar Apr 26 '23 11:04 lokeshuc

Hi @janus-reith! :) Is there anyone currently assigned to this issue?

rafeyshah avatar Jun 07 '23 16:06 rafeyshah

Hi @zenweasel , @janus-reith can I give a try to fix this issue ?

aditya-padhi-kbl avatar Oct 04 '23 06:10 aditya-padhi-kbl

Hi @aditya-padhi-kbl i just assigned you this task

delagroove avatar Oct 06 '23 11:10 delagroove

Hi @aditya-padhi-kbl i just assigned you this task

Looking into it

aditya-padhi-kbl avatar Oct 11 '23 21:10 aditya-padhi-kbl

Hi @delagroove , I have set up the environment by following the steps from here

Just wanted to know how can I reproduce the issue so that I can start debugging

aditya-padhi-kbl avatar Oct 13 '23 09:10 aditya-padhi-kbl

@delagroove please assign me the task if its not yet done

Jacobojijo avatar Oct 25 '23 12:10 Jacobojijo

Is this bug fixed? if not please assign it to me @janus-reith

Rakeshcolan avatar Feb 22 '24 10:02 Rakeshcolan