Skip to content

Conversation

@NicolasGorga
Copy link
Contributor

@NicolasGorga NicolasGorga commented Nov 26, 2025

Summary

What — What changes are introduced in this PR?

Price lists prices didn't have a dedicated method to query them and instead, relied on being returned as part of price lists. This, however, introduces optimization issues that for price lists with many prices, could cause crashes. The reason being that relations are not paginated and thus, all prices linked to the price list would be returned.

This PR aims to solve this by introducing a dedicated endpoint and avoiding returning the prices as part of price lists by default. The idea being that it is up to the user to explicitly express this, which, for small price lists no issues will arise, but for bigger ones, they will easily recognize the performance impact.

Why — Why are these changes relevant or necessary?

Users with large enough price lists would have serious performance issues or even crashes when querying the /admin/price-lists endpoints. This is also true when navigating to the price list section of the Admin UI since it queries this same endpoints.

How — How have these changes been implemented?

  • Removed the prices relation to be part of the default fields returned by the /admin/price-lists/ endpoints. User may still request it by passing it in fields query param.
  • Added new /admin/price-lists/[id]/prices GET endpoint to be able to retrieve a price list prices with pagination.

Testing — How have these changes been tested, or how can the reviewer test the feature?

Integration tests.


Examples

Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.
This helps with documentation and ensures maintainers can quickly understand and verify the change.

// Example usage

Checklist

Please ensure the following before requesting a review:

  • I have added a changeset for this PR
    • Every non-breaking change should be marked as a patch
    • To add a changeset, run yarn changeset and follow the prompts
  • The changes are covered by relevant tests
  • I have verified the code works as intended locally
  • I have linked the related issue(s) if applicable

Additional Context

The current state of the PR fixes the issue on the price list list and detail component. It still doesn't solve the issue for the following screens: Edit Prices & Add Prices

All the prices are still retrieved from the /admin/price-lists/ endpoint for these. I want first some feedback before changing it to the new endpoint, since the current DataGrid implementation doesn't support pagination and it seems we are passing a default limit for the products to show there, an arbitrarily large number 9999 and there is also a TODO comment of changing that.

This previous point, though, could be implemented in a later PR, so we can already fix the issue in the price list list and detail pages, so at least for large price lists these screens don't explode and smaller price lists can still have its product prices edited, while only large ones will explode when trying to perform this action. @adrien2p @fPolic thoughts?

closes ENTSUP-265, CORE-1239

@NicolasGorga NicolasGorga requested a review from a team as a code owner November 26, 2025 22:06
@changeset-bot
Copy link

changeset-bot bot commented Nov 26, 2025

🦋 Changeset detected

Latest commit: cee8da7

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

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

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

8 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
api-reference Ignored Ignored Nov 26, 2025 10:06pm
api-reference-v2 Ignored Ignored Nov 26, 2025 10:06pm
cloud-docs Ignored Ignored Nov 26, 2025 10:06pm
docs-ui Ignored Ignored Nov 26, 2025 10:06pm
docs-v2 Ignored Ignored Nov 26, 2025 10:06pm
medusa-docs Ignored Ignored Nov 26, 2025 10:06pm
resources-docs Ignored Ignored Nov 26, 2025 10:06pm
user-guide Ignored Ignored Nov 26, 2025 10:06pm

@NicolasGorga
Copy link
Contributor Author

/snapshot-this

@github-actions
Copy link
Contributor

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/admin-bundler@3.0.0-snapshot-20251126221441
yarn add @medusajs/admin-sdk@3.0.0-snapshot-20251126221441
yarn add @medusajs/admin-shared@3.0.0-snapshot-20251126221441
yarn add @medusajs/admin-vite-plugin@3.0.0-snapshot-20251126221441
yarn add @medusajs/dashboard@3.0.0-snapshot-20251126221441
yarn add create-medusa-app@3.0.0-snapshot-20251126221441
yarn add @medusajs/cli@3.0.0-snapshot-20251126221441
yarn add medusa-dev-cli@3.0.0-snapshot-20251126221441
yarn add @medusajs/medusa-oas-cli@3.0.0-snapshot-20251126221441
yarn add @medusajs/core-flows@3.0.0-snapshot-20251126221441
yarn add @medusajs/framework@3.0.0-snapshot-20251126221441
yarn add @medusajs/js-sdk@3.0.0-snapshot-20251126221441
yarn add @medusajs/modules-sdk@3.0.0-snapshot-20251126221441
yarn add @medusajs/orchestration@3.0.0-snapshot-20251126221441
yarn add @medusajs/types@3.0.0-snapshot-20251126221441
yarn add @medusajs/utils@3.0.0-snapshot-20251126221441
yarn add @medusajs/workflows-sdk@3.0.0-snapshot-20251126221441
yarn add @medusajs/deps@3.0.0-snapshot-20251126221441
yarn add @medusajs/icons@3.0.0-snapshot-20251126221441
yarn add @medusajs/ui@4.0.28-snapshot-20251126221441
yarn add @medusajs/ui-preset@3.0.0-snapshot-20251126221441
yarn add @medusajs/medusa@3.0.0-snapshot-20251126221441
yarn add @medusajs/telemetry@3.0.0-snapshot-20251126221441
yarn add @medusajs/test-utils@3.0.0-snapshot-20251126221441
yarn add @medusajs/analytics@3.0.0-snapshot-20251126221441
yarn add @medusajs/api-key@3.0.0-snapshot-20251126221441
yarn add @medusajs/auth@3.0.0-snapshot-20251126221441
yarn add @medusajs/cache-inmemory@3.0.0-snapshot-20251126221441
yarn add @medusajs/cache-redis@3.0.0-snapshot-20251126221441
yarn add @medusajs/caching@3.0.0-snapshot-20251126221441
yarn add @medusajs/cart@3.0.0-snapshot-20251126221441
yarn add @medusajs/currency@3.0.0-snapshot-20251126221441
yarn add @medusajs/customer@3.0.0-snapshot-20251126221441
yarn add @medusajs/event-bus-local@3.0.0-snapshot-20251126221441
yarn add @medusajs/event-bus-redis@3.0.0-snapshot-20251126221441
yarn add @medusajs/file@3.0.0-snapshot-20251126221441
yarn add @medusajs/fulfillment@3.0.0-snapshot-20251126221441
yarn add @medusajs/index@3.0.0-snapshot-20251126221441
yarn add @medusajs/inventory@3.0.0-snapshot-20251126221441
yarn add @medusajs/link-modules@3.0.0-snapshot-20251126221441
yarn add @medusajs/locking@3.0.0-snapshot-20251126221441
yarn add @medusajs/notification@3.0.0-snapshot-20251126221441
yarn add @medusajs/order@3.0.0-snapshot-20251126221441
yarn add @medusajs/payment@3.0.0-snapshot-20251126221441
yarn add @medusajs/pricing@3.0.0-snapshot-20251126221441
yarn add @medusajs/product@3.0.0-snapshot-20251126221441
yarn add @medusajs/promotion@3.0.0-snapshot-20251126221441
yarn add @medusajs/analytics-local@3.0.0-snapshot-20251126221441
yarn add @medusajs/analytics-posthog@3.0.0-snapshot-20251126221441
yarn add @medusajs/auth-emailpass@3.0.0-snapshot-20251126221441
yarn add @medusajs/auth-github@3.0.0-snapshot-20251126221441
yarn add @medusajs/auth-google@3.0.0-snapshot-20251126221441
yarn add @medusajs/caching-redis@3.0.0-snapshot-20251126221441
yarn add @medusajs/file-local@3.0.0-snapshot-20251126221441
yarn add @medusajs/file-s3@3.0.0-snapshot-20251126221441
yarn add @medusajs/fulfillment-manual@3.0.0-snapshot-20251126221441
yarn add @medusajs/locking-postgres@3.0.0-snapshot-20251126221441
yarn add @medusajs/locking-redis@3.0.0-snapshot-20251126221441
yarn add @medusajs/notification-local@3.0.0-snapshot-20251126221441
yarn add @medusajs/notification-sendgrid@3.0.0-snapshot-20251126221441
yarn add @medusajs/payment-stripe@3.0.0-snapshot-20251126221441
yarn add @medusajs/region@3.0.0-snapshot-20251126221441
yarn add @medusajs/sales-channel@3.0.0-snapshot-20251126221441
yarn add @medusajs/settings@3.0.0-snapshot-20251126221441
yarn add @medusajs/stock-location@3.0.0-snapshot-20251126221441
yarn add @medusajs/store@3.0.0-snapshot-20251126221441
yarn add @medusajs/tax@3.0.0-snapshot-20251126221441
yarn add @medusajs/user@3.0.0-snapshot-20251126221441
yarn add @medusajs/workflow-engine-inmemory@3.0.0-snapshot-20251126221441
yarn add @medusajs/workflow-engine-redis@3.0.0-snapshot-20251126221441
yarn add @medusajs/draft-order@3.0.0-snapshot-20251126221441

Latest commit: 2cc42ca

@adrien2p
Copy link
Member

@olivermrbl would using the changeset experimental flag onlyUpdatePeerDependentsWhenOutOfRange help us with those major bump on peer deps bump?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants