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

[2.0.5] Admin-ui Fulfillment can not be updated to Shipped if we have split OrderLine into two fulliment #2324

Closed
tianyingchun opened this issue Jul 27, 2023 · 1 comment
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@tianyingchun
Copy link
Contributor

tianyingchun commented Jul 27, 2023

Describe the bug
[2.0.4] Admin-ui Fulfillment can not be updated to Shipped if we have split OrderLine into two fulliment

To Reproduce
Steps to reproduce the behavior:

  1. placed an order with orderLine with quantity: 2
  2. make payment done
  3. go to admin order, create fullfilment with quanity:1, create an fulliment success
  4. try update fulfiment to Shipped it will throw error.
  5. See error
error 7/28/23, 7:36 AM - [Vendure Server] {
  "message": "INTERNAL_SERVER_ERROR: ORDER_STATE_TRANSITION_ERROR",
  "variables": {}
}
Error: ORDER_STATE_TRANSITION_ERROR
    at transitionOrderIfStateAvailable (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/config/fulfillment/default-fulfillment-process.ts:139:23)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleFulfillmentStateTransitByOrder (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/config/fulfillment/default-fulfillment-process.ts:149:13)
    at async Promise.all (index 0)
    at async Object.onTransitionEnd (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/config/fulfillment/default-fulfillment-process.ts:118:9)
    at async awaitPromiseOrObservable (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/common/utils.ts:76:18)
    at async Object.onTransitionEnd (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/service/helpers/fulfillment-state-machine/fulfillment-state-machine.ts:80:25)
    at async awaitPromiseOrObservable (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/common/utils.ts:76:18)
    at async finalize (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/common/finite-state-machine/finite-state-machine.ts:64:25)
    at async FulfillmentService.transitionToState (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/service/services/fulfillment.service.ts:187:9)
    at async OrderService.transitionFulfillmentToState (/Users/tianyingchun/Documents/coding/kzfoo/kzfoo-srv-2.0/node_modules/@vendure/core/src/service/services/order.service.ts:968:24)

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • @vendure/core version: 2.0.5
  • Nodejs version: 18
  • Database (mysql/postgres etc):mysql

Additional context
Add any other context about the problem here.

@tianyingchun tianyingchun added the type: bug 🐛 Something isn't working label Jul 27, 2023
@tianyingchun tianyingchun changed the title [2.0.4] Admin-ui Fulfillment can not be updated to Shipped if we have split OrderLine into two fulliment [2.0.5] Admin-ui Fulfillment can not be updated to Shipped if we have split OrderLine into two fulliment Jul 27, 2023
@alexisvigoureux
Copy link
Contributor

alexisvigoureux commented Jul 28, 2023

Hi @michaelbromley, we've come across exactly the same error for the same use case

InternalServerError [Error]: ORDER_STATE_TRANSITION_ERROR
    at transitionOrderIfStateAvailable (/Users/alexis.vigoureux/Documents/com.swile/gift-store-back/node_modules/@vendure/core/src/config/fulfillment/default-fulfillment-process.ts:139:23)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at handleFulfillmentStateTransitByOrder (/Users/alexis.vigoureux/Documents/com.swile/gift-store-back/node_modules/@vendure/core/src/config/fulfillment/default-fulfillment-process.ts:149:13)
    at async Promise.all (index 0)
    at Object.onTransitionEnd (/Users/alexis.vigoureux/Documents/com.swile/gift-store-back/node_modules/@vendure/core/src/config/fulfillment/default-fulfillment-process.ts:118:9)
    at awaitPromiseOrObservable (/Users/alexis.vigoureux/Documents/com.swile/gift-store-back/node_modules/@vendure/core/src/common/utils.ts:76:18)
    at Object.onTransitionEnd (/Users/alexis.vigoureux/Documents/com.swile/gift-store-back/node_modules/@vendure/core/src/service/helpers/fulfillment-state-machine/fulfillment-state-machine.ts:80:25)
    at awaitPromiseOrObservable (/Users/alexis.vigoureux/Documents/com.swile/gift-store-back/node_modules/@vendure/core/src/common/utils.ts:76:18)
    at finalize (/Users/alexis.vigoureux/Documents/com.swile/gift-store-back/node_modules/@vendure/core/src/common/finite-state-machine/finite-state-machine.ts:64:25)
    at FulfillmentService.transitionToState (/Users/alexis.vigoureux/Documents/com.swile/gift-store-back/node_modules/@vendure/core/src/service/services/fulfillment.service.ts:187:9) {
  extensions: { code: 'INTERNAL_SERVER_ERROR' },
  variables: {},
  code: 'INTERNAL_SERVER_ERROR',
  logLevel: 0
}

Environment:
@vendure/core version: 2.0.5
Nodejs version: 18.15
Database: postgresql

@michaelbromley michaelbromley moved this to 📋 Backlog in Vendure OS Roadmap Jul 28, 2023
@michaelbromley michaelbromley moved this from 📋 Backlog to 🏗 In progress in Vendure OS Roadmap Aug 7, 2023
@michaelbromley michaelbromley moved this from 🏗 In progress 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

3 participants