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

fix: Set order to open before the market order is posted #2548

Merged
merged 1 commit into from
May 16, 2024

Conversation

holzeis
Copy link
Contributor

@holzeis holzeis commented May 16, 2024

Otherwise it could happen that we may process the offer setting the order to Filling before we set the order to Open (which would overwrite the execution price).

fixes #2547

Otherwise it could happen that we may process the offer setting the order to `Filling` before we set the order to `Open` (which would overwrite the execution price.
@holzeis holzeis requested review from bonomat and luckysori May 16, 2024 09:45
@holzeis holzeis self-assigned this May 16, 2024
@holzeis holzeis merged commit be950c2 into main May 16, 2024
23 checks passed
@holzeis holzeis deleted the fix/race-condition-on-order-updates branch May 16, 2024 10:08
@@ -108,6 +108,7 @@ pub async fn submit_order_internal(
let url = Url::parse(&url).expect("correct URL");
let orderbook_client = OrderbookClient::new(url);

set_order_to_open_and_update_ui(order.id).map_err(SubmitOrderError::Storage)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it probably doesn't hurt, but you do it twice now. Second time is on line 134

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh! 🙈 It absolutely matters! Thanks for spotting it.. this wouldn't have fixed a thing 🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order state updated from filling to open
2 participants