-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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(core-flows, types): reservation of shared inventory item #11403
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Skipped Deployments
|
const reservations = await locking.execute(inventoryItemIds, async () => { | ||
const lockingKeys = Array.from(new Set(inventoryItemIds)) | ||
|
||
const reservations = await locking.execute(lockingKeys, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: if we create multiple reservations of the same inventory item in this step (one for each item in a cart that has items which share the inventory item) we need to deduplicate keys otherwise we will have deadlock. We need to update this in few more places if you agree with the approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch.
const reservations = await locking.execute(inventoryItemIds, async () => { | ||
const lockingKeys = Array.from(new Set(inventoryItemIds)) | ||
|
||
const reservations = await locking.execute(lockingKeys, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch.
What
completed_at
when compensating cart updateCLOSES SUP-587