fix(medusa): Race condition in cart completion strategy (#2341)
This commit is contained in:
committed by
GitHub
parent
94eb2bfc02
commit
5908d9b9b6
@@ -328,9 +328,15 @@ class CartCompletionStrategy extends AbstractCartCompletionStrategy {
|
||||
if (err) {
|
||||
if (idempotencyKey.recovery_point !== "started") {
|
||||
await this.manager_.transaction(async (transactionManager) => {
|
||||
await cartService
|
||||
.withTransaction(transactionManager)
|
||||
.deleteTaxLines(id)
|
||||
try {
|
||||
await orderService
|
||||
.withTransaction(transactionManager)
|
||||
.retrieveByCartId(id)
|
||||
} catch (error) {
|
||||
await cartService
|
||||
.withTransaction(transactionManager)
|
||||
.deleteTaxLines(id)
|
||||
}
|
||||
})
|
||||
}
|
||||
throw err
|
||||
|
||||
Reference in New Issue
Block a user