Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cancelOrderItem can't deal with concurrent requests properly #6493

Open
janus-reith opened this issue Jan 20, 2021 · 12 comments
Open

cancelOrderItem can't deal with concurrent requests properly #6493

janus-reith opened this issue Jan 20, 2021 · 12 comments
Labels
bug For issues that describe a defect or regression in the released software good first issue For issues that a new contributor could likely submit a pull request for without needing much help hacktoberfest Tickets good for hackathon work needs triage For issues that are awaiting triage by the core development team

Comments

@janus-reith
Copy link
Collaborator

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 janus-reith added bug For issues that describe a defect or regression in the released software needs triage For issues that are awaiting triage by the core development team labels Jan 20, 2021
@zenweasel zenweasel transferred this issue from reactioncommerce/api-plugin-orders Sep 21, 2022
@zenweasel zenweasel added good first issue For issues that a new contributor could likely submit a pull request for without needing much help hacktoberfest Tickets good for hackathon work labels Oct 27, 2022
@chethan27
Copy link

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

@zenweasel
Copy link
Collaborator

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

@lokeshuc
Copy link

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

@sujithvn
Copy link
Contributor

@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.

@lokeshuc
Copy link

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

@rafeyshah
Copy link

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

@aditya-padhi-kbl
Copy link

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

@delagroove
Copy link
Contributor

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

@aditya-padhi-kbl
Copy link

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

Looking into it

@aditya-padhi-kbl
Copy link

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 aditya-padhi-kbl removed their assignment Oct 17, 2023
@Jacobojijo
Copy link

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

@Rakeshcolan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a defect or regression in the released software good first issue For issues that a new contributor could likely submit a pull request for without needing much help hacktoberfest Tickets good for hackathon work needs triage For issues that are awaiting triage by the core development team
Projects
Current Work
  
Plan
Development

No branches or pull requests

10 participants