Skip to content

Move Order Complete Emit on Cart Complete later in the flow#13630

Closed
vethan wants to merge 2 commits intomedusajs:developfrom
vethan:emit-order-placed-later-in-cart-complete-flow
Closed

Move Order Complete Emit on Cart Complete later in the flow#13630
vethan wants to merge 2 commits intomedusajs:developfrom
vethan:emit-order-placed-later-in-cart-complete-flow

Conversation

@vethan
Copy link
Copy Markdown
Contributor

@vethan vethan commented Sep 30, 2025

Emit the order placed event later in the flow, so it is not emitted if the cart-complete is rolled back due to payment failure or any other issue occurring later in the workflow


Note

Emit OrderWorkflowEvents.PLACED after order creation (post-payment) instead of during the earlier parallel steps, preventing emission when the workflow reverts.

  • Core Flows (complete-cart):
    • Move emitEventStep for OrderWorkflowEvents.PLACED from the early parallelize(...) block to after orderCreated hook (post payment authorization/transactions).
    • Ensures the order placed event is only emitted after successful order creation/payment, avoiding emission on failure/rollback.

Written by Cursor Bugbot for commit e46d204. This will update automatically on new commits. Configure here.

…f the cart-complete is rolled back due to payment failure or any other issue occuring later in the workflow
@vethan vethan requested a review from a team as a code owner September 30, 2025 14:23
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 30, 2025

🦋 Changeset detected

Latest commit: e46d204

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 72 packages
Name Type
@medusajs/core-flows Patch
@medusajs/medusa Patch
integration-tests-http Patch
@medusajs/test-utils Patch
@medusajs/medusa-oas-cli Patch
@medusajs/analytics Patch
@medusajs/api-key Patch
@medusajs/auth Patch
@medusajs/cart Patch
@medusajs/currency Patch
@medusajs/customer Patch
@medusajs/file Patch
@medusajs/fulfillment Patch
@medusajs/index Patch
@medusajs/inventory Patch
@medusajs/link-modules Patch
@medusajs/locking Patch
@medusajs/notification Patch
@medusajs/order Patch
@medusajs/payment Patch
@medusajs/pricing Patch
@medusajs/product Patch
@medusajs/promotion Patch
@medusajs/region Patch
@medusajs/sales-channel Patch
@medusajs/settings Patch
@medusajs/stock-location Patch
@medusajs/store Patch
@medusajs/tax Patch
@medusajs/user Patch
@medusajs/workflow-engine-inmemory Patch
@medusajs/workflow-engine-redis Patch
@medusajs/draft-order Patch
@medusajs/oas-github-ci Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
@medusajs/analytics-local Patch
@medusajs/analytics-posthog Patch
@medusajs/auth-emailpass Patch
@medusajs/auth-github Patch
@medusajs/auth-google Patch
@medusajs/file-local Patch
@medusajs/file-s3 Patch
@medusajs/fulfillment-manual Patch
@medusajs/locking-postgres Patch
@medusajs/locking-redis Patch
@medusajs/notification-local Patch
@medusajs/notification-sendgrid Patch
@medusajs/payment-stripe Patch
@medusajs/framework Patch
@medusajs/js-sdk Patch
@medusajs/modules-sdk Patch
@medusajs/orchestration Patch
@medusajs/types Patch
@medusajs/utils Patch
@medusajs/workflows-sdk Patch
@medusajs/cli Patch
@medusajs/deps Patch
@medusajs/telemetry Patch
@medusajs/admin-bundler Patch
@medusajs/admin-sdk Patch
@medusajs/admin-shared Patch
@medusajs/admin-vite-plugin Patch
@medusajs/dashboard Patch
@medusajs/icons Patch
@medusajs/toolbox Patch
@medusajs/ui-preset Patch
create-medusa-app Patch
medusa-dev-cli Patch
@medusajs/ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 30, 2025

@vethan is attempting to deploy a commit to the medusajs Team on Vercel.

A member of the Team first needs to authorize it.

@adrien2p
Copy link
Copy Markdown
Contributor

adrien2p commented Sep 30, 2025

hey @vethan, I am curious to understand the issue you are facing because the events are not emitted, they are stored in the event group and will only be released once the workflow is finished 🤔 same goes with failed and reverted workflows, we do not emit the event group

@carlos-r-l-rodrigues
Copy link
Copy Markdown
Contributor

Hi @vethan, Thanks for the PR.
I'm closing this one in favor of #13645 that will fix the cart complete issues.

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.

3 participants