Fix placing the order twice

Created on 5 February 2023, almost 2 years ago
Updated 9 July 2023, over 1 year ago

Problem/Motivation

onNotify and onReturn methods might run at the same time, and if that happened, the state of the order when entering onReturn method will not be "completed" so while onNotify is placing the order, onReturn will place it as well.

This patch in this issue 🐛 The changes made to the order on the onNotify method are not applied on the onReturn method Fixed fixes the problem by applying locks to the order so if onNotify started, onReturn will have to wait and only then check the order state.

When applying the above patch, we can use loadForUpdate method inside onNotify instead of load to make use of the locking mechanism.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024