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

Draft orders are never placed #2105

Closed
martijnvdbrug opened this issue Mar 29, 2023 · 3 comments
Closed

Draft orders are never placed #2105

martijnvdbrug opened this issue Mar 29, 2023 · 3 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@martijnvdbrug
Copy link
Collaborator

Describe the bug
The order placement strategy is never called for Draft orders, so draft orders are never placed.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Draft order
  2. Move it to PaymentSettled
  3. The order has no placedAt date and the OrderPlacedEvent is never emitted

The order placed strategy is never called, because a draft order is never active:

Expected behavior
Draft orders should trigger the same OrderPlacedStrategy as shop-api orders

  • Fixing this will also cause order confirmations to be sent for draft orders, is that expected?
  • Is there any need for differentiating between Draft order settlement and normal orders? If so we might need to introduce something like order.isDraft

Environment (please complete the following information):

  • @vendure/core version: 1.9.5
  • Nodejs version 16
  • Database (mysql/postgres etc): MySQL
@martijnvdbrug martijnvdbrug added the type: bug 🐛 Something isn't working label Mar 29, 2023
@DanielBiegler
Copy link
Contributor

Just ran into this again when I investigated why orders created from drafts don't show up in the metrics widget.

  1. Draft orders are never active
  2. This leads to drafted orders never being settled for the reason @martijnvdbrug pointed out
  3. This means orderPlacedAt is null
  4. This leads to them not showing up in the metric queries because it expects a date

Fixing this issue would allow drafted orders to show up in metric widgets.

@hrishikeshdkakkad
Copy link

Why is this code still not a part of the master branch?
What does the release process look like?

@michaelbromley
Copy link
Member

Why is this code still not a part of the master branch?

because nobody yet made the required changes to fix it.

What does the release process look like?

We aim for patch releases every 2 weeks or so. Whatever has been fixed in that time window will make it in to that patch release. Most fixes are done by myself, but a significant amount of work is also done by the open source community and since this is open source, users are encouraged to contribute to fixes they want to see released, for the benefit of all :)

@michaelbromley michaelbromley moved this from 📋 Backlog to 🏗 In progress in Vendure OS Roadmap Jul 12, 2023
@michaelbromley michaelbromley moved this from 🏗 In progress to 🔖 Ready in Vendure OS Roadmap Jul 13, 2023
@michaelbromley michaelbromley moved this from 🔖 Ready to ✅ Done in Vendure OS Roadmap Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
Status: 🚀 Shipped
Development

No branches or pull requests

4 participants