Highlights
Indexing of core entities
Medusa Index was built to improve the developer experience of filtering data across modules while improving performance, especially for large data sets.
With this release, all entities in the core Medusa modules are now ingestible into Medusa Index. This unlocks cross-module filtering for all core and custom entities. The ingestion happens automatically, provided a link is defined between the entities, as described in our documentation.
For example, filtering Products by Sales Channels used to require the following steps:
// 🔴 BEFORE
const query = container.resolve("query")
// Sales Channels to filter by
const salesChannels = ["sc_1234"]
// Query the Sales Channel <> Product link table for matching links
const { data: links } = await query.graph({
entity: "product_sales_channel",
fields: ["product_id"],
filters: {
sales_channel_id: salesChannels
}
})
// Construct the products filter using the matched links
const productFilters = {
id: links.map(link => link.product_id)
}
// Finally query the products with the filters
const { data: products } = await query.graph({
entity: "product",
fields: ["id"],
filters: productFilters
})
With Index, the same example from above can be done with a single query:
// 🟢 NOW
const query = container.resolve("query")
// Sales Channels to filter by
const salesChannels = ["sc_1234"]
// Query the products with the sales channel filter
const { data: products } = await query.index({
entity: "product",
fields: ["id"],
filters: { sales_channels: { id: salesChannels } },
})
Note that in the second code snippet, we use query.index
instead of query.graph
to query Medusa Index.
For setup and usage details of Medusa Index, see our documentation.
Locking all cart operations
All cart workflows in Medusa's core are now locking the cart during execution to eliminate the risk of concurrent changes.
We would recommend that you introduce the same locking mechanism to your own custom cart workflows.
Here's how you would do it:
export const myCustomAddToCartWorkflow = createWorkflow("my-custom-add-to-cart-workflow",
(input) => {
// Acquire a lock on the cart ID as the first step in the workflow
acquireLockStep({
key: input.cart_id,
timeout: 2, // Attempt to acquire the lock for two seconds before timing out
ttl: 10, // Lock is only held for a maximum of ten seconds
})
// Run all regular cart operations
// Release the lock on the cart ID as the last step in the workflow
releaseLockStep({
key: cart.id,
})
return new WorkflowResponse({ ... })
}
)
Features
- feat(promotion): Allow buyget promotion to apply multiple times on cart by @riqwan in #13305
- feat(admin): add view configuration client infrastructure by @srindom in #13186
- Feat/datatable core enhancements by @srindom in #13193
- feat(ui): add column visibility and drag-and-drop reordering support by @srindom in #13198
- feat(admin): add configurable order views by @srindom in #13211
- feat(dashboard,cart,types,utils): refine order details summary by @willbouch in #13313
- chore(orchestration): add support for autoRetry, maxAwaitingRetries, retryStep by @adrien2p in #13391
Bugs
- fix(dashboard): rules form operator change by @fPolic in #13324
- fix(core-flows): handle cacluated shipping options on draft orders gracefully by @fPolic in #13353
- fix(utils): big bumber should give numeric value of 0 for small numbers by @willbouch in #13394
- fix(dashboard, ui): ensure radix deps version by @fPolic in #13392
- fix(dashboard): promotion decimal value definition by @fPolic in #13371
- fix(dashboard): customer
has_acccount
flag by @fPolic in #13414 - fix(dashboard): support more decimals for tx rates by @willbouch in #13407
- fix: Missing DB traces in instrumentation by @olivermrbl in #13429
- fix(index): index enum fields by @carlos-r-l-rodrigues in #13428
- fix(medusa): Use default logger in plugin:develop by @olivermrbl in #13375
- fix(medusa): stop loading entry points in exec command by @willbouch in #13438
- fix(dashboard): edit rules clear and reset by @fPolic in #13423
- fix(): Prevent ci to fail if lock file does not exists by @adrien2p in #13456
- fix(): missing events by @adrien2p in #13465
- fix(): product image missing index by @adrien2p in #13466
- fix(): temporary transform cached data by @adrien2p in #13467
- fix(): prepare list query for list by @adrien2p in #13476
- chore(): improve inventory module by @adrien2p in #13463
- fix(): update cart line item route fetching by @adrien2p in #13477
- fix(medusa,product): fix ordering product categories by @willbouch in #13487
Documentation
- docs-util: fix error in references pipeline by @shahednasser in #13343
- docs: generate references for 2.10.1 by @shahednasser in #13344
- docs-util: fix workflows not picked for some routes + generate OAS by @shahednasser in #13342
- docs: document scheduled jobs interval by @shahednasser in #13350
- docs: add troubleshooting guide for pnpm installations by @shahednasser in #13351
- docs: add lockin module provider to deployment guide by @shahednasser in #13361
- docs: document how prices are stored in Medusa by @shahednasser in #13362
- docs: add missing step in product builder guide by @shahednasser in #13370
- docs: added a section on figma mcp + workflows diagram fix by @shahednasser in #13367
- docs: general updates and fixes by @shahednasser in #13374
- docs: change digial products to digital products by @yoreljenkins in #13379
- docs: document feature flags by @shahednasser in #13388
- docs: add more examples for API route responses by @shahednasser in #13399
- docs: show the source code link in order models reference by @shahednasser in #13398
- docs: change text in Cloud homepage by @MedusaNick in #13401
- docs: fix scrollbar not clickable by @shahednasser in #13409
- docs: added a note about payload version by @shahednasser in #13410
- docs: general fixes and improvements by @shahednasser in #13417
- docs: add plan cancelation details by @shahednasser in #13416
- docs: fixes and improvements to price calculation guide by @shahednasser in #13419
- docs: update project creation steps by @shahednasser in #13436
- docs: add graphql dependency to payload guide by @shahednasser in #13440
- chore(): Upgrade mikro orm by @adrien2p in #13390
- docs: add product feed tutorial by @shahednasser in #13366
- docs: fix cancel order information in user guide by @shahednasser in #13447
- docs: fix relations missing from data model reference diagrams by @shahednasser in #13474
- docs: improvements to Cloud homepage by @shahednasser in #13479
- docs: fix saved payment method guide by @shahednasser in #13480
- docs: fix same page link not resolved correctly by @shahednasser in #13481
- docs: add cloud plans & pricing page by @shahednasser in #13420
- docs: ticket booking system guide by @shahednasser in #13471
Chores
- chore(docs): Update version in documentation (automated) by @github-actions[bot] in #13340
- chore(docs): Updated UI Reference (automated) by @github-actions[bot] in #13339
- chore(framework,medusa): load custom flags before medusa config by @carlos-r-l-rodrigues in #13312
- chore(): faster serialization by @adrien2p in #13325
- chore(): improve workflow engine storage by @adrien2p in #13345
- chore: Fix scripts in CLI pipeline by @olivermrbl in #13402
- chore(): only execute race execution checks and publish message only for async workflows by @adrien2p in #13396
- chore(orchestration): remote joiner query planner by @carlos-r-l-rodrigues in #13364
- chore(workflows-sdk, utils): Prevent unnecessary serialization by @adrien2p in #13413
- fix(draft-order, medusa, types): ui polish by @fPolic in #13376
- chore(): Improve some cart operation flows to remove extraneous operations when not required by @adrien2p in #13418
- chore(): Improve workflows sdk tooling by @adrien2p in #13421
- chore(core-flows): lock on cart operations by @carlos-r-l-rodrigues in #13424
- chore(): Workflow engine timers and notification improvements by @adrien2p in #13434
- Chore(): localised improvement to promotion module by @adrien2p in #13446
- chore(): Cart fixes and opti by @adrien2p in #13455
- chore(): Module Internal Events by @adrien2p in #13296
- chore(): order module index and some impl details by @adrien2p in #13462
- chore(): Remove extra manager fork by @adrien2p in #13458
- chore(): Improve link indexes by @adrien2p in #13459
- chore(): Improve cart module by @adrien2p in #13472
- chore(): Add missing product status index by @adrien2p in #13475
Other Changes
- fix(dashboard): promotion expired status check when limit is null by @pepijn-vanvlaanderen in #13373
- feat: Add return type in createPaymentCollectionForCartWorkflow by @gladius882 in #13385
- fix(medusa-test-utils): add DB_PORT env variable support by @0xFl4g in #12782
- fix(dashboard): add missing translations to spanish file by @galdoway in #13426
- fix(dashboard): fix pagination when adding products to price list by @lemonteeea in #13075
- fix(dashboard) update and add missing polish translations by @radeknapora in #13445
- feat(dashboard,currency): added Tajikistani somoni currency by @Amirkhon in #13178
- fix(types): add missing retrieveProductOptionValue to module interface by @SteelRazor47 in #12313
- fix(dashboard): disable broken autofocus in SO cond. price form by @SteelRazor47 in #11944
- Revert "chore(): Upgrade mikro orm (#13390)" by @adrien2p in #13449
- fix(draft-order): use correct backend URL in sdk creation by @SteelRazor47 in #13360
- fix(dashboard): german translation issues by @appinteractive in #13482
- feat(dashboard): improve Korean transl and add missing keys by @rbxorkt12 in #13081
- chore(medusa): add metadata field to AdminCreateInvite by @v0eak in #13469
New Contributors
- @yoreljenkins made their first contribution in #13379
- @0xFl4g made their first contribution in #12782
- @galdoway made their first contribution in #13426
- @lemonteeea made their first contribution in #13075
- @Amirkhon made their first contribution in #13178
- @appinteractive made their first contribution in #13482
- @rbxorkt12 made their first contribution in #13081
- @v0eak made their first contribution in #13469
Full Changelog: v2.10.1...v2.10.2