Commit Graph

8992 Commits

Author SHA1 Message Date
Adrien de Peretti
5ea32aaa44 fix(): Cart workflow price calculation for different items but same variant (#13511)
RESOLVES CORE-1204

**What**
- Fix wrong price tier when multiple items are targetting the same variant
- fix type import from the wrong package

**Notes**
If you are struggling navigating the changes, you can focus on the following files:
```
integration-tests/http/__tests__/cart/store/cart.spec.ts
integration-tests/modules/__tests__/cart/store/cart.workflows.spec.ts
packages/core/core-flows/src/cart/steps/get-promotion-codes-to-apply.ts
packages/core/core-flows/src/cart/steps/get-variant-price-sets.ts
packages/core/core-flows/src/cart/workflows/add-to-cart.ts
packages/core/core-flows/src/cart/workflows/create-carts.ts
packages/core/core-flows/src/cart/workflows/get-variants-and-items-with-prices.ts
packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts
packages/core/core-flows/src/order/workflows/add-line-items.ts
packages/core/core-flows/src/order/workflows/create-order.ts
```
2025-09-26 07:19:46 +00:00
Carlos R. L. Rodrigues
3960c80e9f fix(medusa): start cluster (#13599) 2025-09-25 16:07:22 -03:00
Frane Polić
c3ae529b40 fix(dashboard): payment providers select (#13592)
**What**
- use lazy loading for payment providers select on region create/edit
2025-09-25 17:54:07 +00:00
Bastien
9538df2eaf fix(dashboard): copy phone on order customer info (#13596)
In the order details page, clicking the copy button for customer phone number was incorrectly copying the email address instead of the phone number.

Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
2025-09-25 17:03:59 +00:00
Carlos R. L. Rodrigues
1b57e5c58a fix(core-flows): skip locking by default on subworkflows (#13594) 2025-09-25 09:39:14 -03:00
Aldo Román
45f180a2b5 fix: Correctly type Float properties (#13585)
* Update get-attribute.ts

* update test

* add changeset

* Update .changeset/cold-experts-breathe.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-09-25 07:37:37 -04:00
Frane Polić
7af9e3224c fix(dashboard): improve inventory level location management (#13589)
**What**
- add InfiniteList on location selection for inventory level -> fixes issue with location pagination
- fix removal of location level for an inventory item
- refresh the levels table when locations are updated
- add search input for filtering locations

---

CLOSES CORE-1208
2025-09-24 18:00:45 +00:00
William Bouchard
edf29b3bd2 feat(dashboard): select refund reason in refund form (#13587)
CLOSES CORE-1211

This PR quickly allows the user to select a refund a reason when creating a refund

<img width="1106" height="1618" alt="CleanShot 2025-09-23 at 14 36 39@2x" src="https://github.com/user-attachments/assets/7cb9a53e-82ca-44d3-8267-874153f8d9ac" />


<img width="1870" height="1082" alt="CleanShot 2025-09-23 at 14 36 26@2x" src="https://github.com/user-attachments/assets/ea8d39b2-07e6-4295-ae52-da16b5d0d265" />
2025-09-24 12:06:42 +00:00
Frane Polić
294c37564c fix(dashboard): edit promotion campaign w/wo currrency (#13404)
**What**
- a promotion couldn't be added to a campaign without a currency budget (on promotion details screen)
- fix fetching campaigns pagination issue
- move select to Combobox
- fix currency restriction and move warning description to the label hint
2025-09-24 10:24:11 +00:00
Shahed Nasser
c4c2231a31 docs: create returns from storefront tutorial (#13522)
* docs: create returns from storefront tutorial

* small change

* generate llms

* add location ID
2025-09-24 12:06:26 +03:00
Frane Polić
10787c865f feat(dashboard): refactor location list UI to use data table (#13571)
* wip: convert location list to a table

* chore: changeset

* fix: rm search bluring on loading change

* feat: translations and palceholders, cleanup, make content more compact

* fix: delete message

* chore: optimise use memo

* fix: update toast

* feat: make stock location address searchable

* fix: search input blur on load finish
2025-09-24 10:29:13 +02:00
Frane Polić
6e806942c7 fix:(dasboard, order): set return status on cancel (#13578) 2025-09-24 08:48:00 +02:00
William Bouchard
5e827ec95d feat(admin-shared,dashboard,js-sdk,types): refund reasons in dashboard (#13575)
CLOSES CORE-1209

This PR just adds the stuff necessary to support refund reasons in the dashboard. It adds the option in the settings tab and allows viewing, creating, editing and deleting refund reasons. I hate to open such a big PR but most of it is copy pasted from the return reasons. Major difference is only the fact that refund reasons don't have a `value` field
2025-09-23 15:51:40 +00:00
Adrien de Peretti
543c9f7d0f fix(utils): Query filters API should have nested optional props (#13583) 2025-09-23 17:40:37 +02:00
Ayman Mustafa
a75cf7fb36 feat(dashboard): support RTL in dashboard (#11252)
* fix: add direction attribute to components and adjust styles for RTL support

* fix(data-grid): comment it out

* Added useDocumentDirection hook

* refactor: Integrate useDocumentDirection hook

* refactor: Standardize direction prop usage across components

* resolve

* fix: resolve build errors

* fix : remove unused useDocument

* Apply RTL styles for some components

* Create smooth-gorillas-hide.md

* refactor: update some styles for RTL support

---------

Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
2025-09-23 11:11:30 -04:00
Hakim Saoudi
a501364b2d fix(product): Correctly fetch category descendants by handle (#13579)
This PR fixes the issue #13518  where product category descendants were not retrieved when
filtering by handle with the include_descendants_tree flag. The handle filter was not
being correctly removed before the descendant tree query was executed.
2025-09-23 14:40:31 +00:00
Bastien
513b352da3 feat(store): add id filtering to store collections endpoint (#13555)
* feat(store): add id filtering to store collections endpoint

* 🐛 Fix circular type reference

*  Add changeset
2025-09-23 10:37:32 -04:00
Eric Wätke
e074050e97 docs: update GitHub link in ticket booking example (#13582)
Updates link in the ticket booking example to the correct url

fixes: https://github.com/medusajs/examples/issues/78
2025-09-23 13:31:08 +00:00
Shahed Nasser
6a91f79f44 feat(js-sdk): allow passing a query parameter to deleteLineItem (#13581) 2025-09-23 11:47:10 +00:00
William Bouchard
f6df0466ab Revert "fix(types): pluralize words ending in s like status" (#13574)
Reverts medusajs/medusa#13461
2025-09-23 07:54:03 +00:00
Trevor
295f6be146 Fixed premature teardown in medusa-test-runner (#13038)
* Fixed premature teardown in medusa-test-runner

* modified:   packages/medusa-test-utils/src/medusa-test-runner.ts

* new file:   .changeset/clever-balloons-learn.md
	modified:   packages/medusa-test-utils/src/medusa-test-runner.ts

* modified:   packages/medusa-test-utils/src/medusa-test-runner.ts

* modified:   packages/medusa-test-utils/src/medusa-test-runner.ts

	modified:   packages/medusa-test-utils/src/medusa-test-runner.ts
	modified:   packages/medusa-test-utils/src/medusa-test-runner.ts

* modified:   packages/medusa-test-utils/src/medusa-test-runner.ts

* modified:   packages/medusa-test-utils/src/medusa-test-runner.ts

* Fix optional chaining in afterEach method

* added missing implementation of disableAutoTeardown feature in the medusaIntegrationTestRunner method.

---------

Co-authored-by: Trevor N. <trevor@pegasuscart.com>
Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-09-23 09:27:52 +02:00
Shahed Nasser
bcc30ccc39 docs: fix @medusajs/ui version in docs (#13577) 2025-09-23 09:29:57 +03:00
kusonsaelee
9fc32ba7c7 fix(stripe): add StripePromptPayService to Stripe module provider (#13572)
* fix(stripe): add StripePromptPayService to Stripe module provider

* Add changeset for StripePromptPayService fix
2025-09-22 15:46:56 -04:00
William Bouchard
4125665776 Revert "fix(types): pluralize settings" (#13573)
Reverts medusajs/medusa#13558
2025-09-22 19:03:31 +00:00
Adrien de Peretti
e39c472a84 Feat(): faster entity serializer (#13564)
**What**
Improve serialization further on complex entities to reduce bottleneck.

**Notes**
It might good at some point to integrate these improvements into mikro orm package 📦 


**Load test**
The test is using autocanon and wrap the serializers call behind http end points.
Each product has 2 variants, 3 options and 3 options values.

autocanon is configured for 10 connections during 20 second and 1 pipelining. This is repeated for each configuration and each catch size.

    🚀 Load Testing Serializers with Autocannon
    ================================================================================

    ====================================================================================================
    🎯 TESTING 10 PRODUCTS
    ====================================================================================================
    🖥️  Server started on port 57840
    📊 Testing with 10 products per request

    🔥 Load testing: MikroOrm
    --------------------------------------------------
       Requests/sec: 33.85
       Avg Latency: 319.30ms
       P90 Latency: 327.00ms
       Throughput: 31.36 MB/s
       Errors: 0

    🔥 Load testing: Current
    --------------------------------------------------
       Requests/sec: 821.15
       Avg Latency: 11.67ms
       P90 Latency: 12.00ms
       Throughput: 0.18 MB/s
       Errors: 0

    🔥 Load testing: Optimized
    --------------------------------------------------
       Requests/sec: 1286.75
       Avg Latency: 7.25ms
       P90 Latency: 7.00ms
       Throughput: 37.31 MB/s
       Errors: 0

    📈 Load Testing Performance Comparison for 10 products:
    --------------------------------------------------------------------------------------------------------------------------------------------
    Serializer      Requests/sec    Avg Latency (ms)   P90 Latency (ms)   Throughput (MB/s)  Errors     RPS Improvement
    --------------------------------------------------------------------------------------------------------------------------------------------
    MikroOrm        33.85           319.30             327.00             31.36              0          baseline
    Current         821.15          11.67              12.00              0.18               0          24.3x
    Optimized       1286.75         7.25               7.00               37.31              0          38.0x

    🎯 Key Insights for 10 products:
       • Optimized serializer handles 1.6x more requests/sec than Current
       • Optimized serializer handles 38.0x more requests/sec than MikroOrm
       • 37.9% lower latency compared to Current  serializer

    🔴 Server stopped for 10 products test

    ====================================================================================================
    🎯 TESTING 100 PRODUCTS
    ====================================================================================================
    🖥️  Server started on port 57878
    📊 Testing with 100 products per request

    🔥 Load testing: MikroOrm
    --------------------------------------------------
       Requests/sec: 3.69
       Avg Latency: 3241.29ms
       P90 Latency: 4972.00ms
       Throughput: 35.04 MB/s
       Errors: 0

    🔥 Load testing: Current
    --------------------------------------------------
       Requests/sec: 87.45
       Avg Latency: 117.20ms
       P90 Latency: 116.00ms
       Throughput: 0.02 MB/s
       Errors: 0

    🔥 Load testing: Optimized
    --------------------------------------------------
       Requests/sec: 143.56
       Avg Latency: 70.62ms
       P90 Latency: 72.00ms
       Throughput: 42.22 MB/s
       Errors: 0

    📈 Load Testing Performance Comparison for 100 products:
    --------------------------------------------------------------------------------------------------------------------------------------------
    Serializer      Requests/sec    Avg Latency (ms)   P90 Latency (ms)   Throughput (MB/s)  Errors     RPS Improvement
    --------------------------------------------------------------------------------------------------------------------------------------------
    MikroOrm        3.69            3241.29            4972.00            35.04              0          baseline
    Current         87.45           117.20             116.00             0.02               0          23.7x
    Optimized       143.56          70.62              72.00              42.22              0          38.9x

    🎯 Key Insights for 100 products:
       • Optimized serializer handles 1.6x more requests/sec than Current
       • Optimized serializer handles 38.9x more requests/sec than MikroOrm
       • 39.7% lower latency compared to Current  serializer

    🔴 Server stopped for 100 products test

    ====================================================================================================
    🎯 TESTING 1,000 PRODUCTS
    ====================================================================================================
    🖥️  Server started on port 57930
    📊 Testing with 1000 products per request

    🔥 Load testing: MikroOrm
    --------------------------------------------------
       Requests/sec: 0.00
       Avg Latency: 0.00ms
       P90 Latency: 0.00ms
       Throughput: 0.00 MB/s
       Errors: 10

    🔥 Load testing: Current
    --------------------------------------------------
       Requests/sec: 0.00
       Avg Latency: 0.00ms
       P90 Latency: 0.00ms
       Throughput: 0.00 MB/s
       Errors: 20

    🔥 Load testing: Optimized
    --------------------------------------------------
       Requests/sec: 13.79
       Avg Latency: 792.94ms
       P90 Latency: 755.00ms
       Throughput: 41.47 MB/s
       Errors: 0

    📈 Load Testing Performance Comparison for 1000 products:
    --------------------------------------------------------------------------------------------------------------------------------------------
    Serializer      Requests/sec    Avg Latency (ms)   P90 Latency (ms)   Throughput (MB/s)  Errors     RPS Improvement
    --------------------------------------------------------------------------------------------------------------------------------------------
    MikroOrm        0.00            0.00               0.00               0.00               10         NaNx
    Current         0.00            0.00               0.00               0.00               20         NaNx
    Optimized       13.79           792.94             755.00             41.47              0          Infinityx

    🎯 Key Insights for 1000 products:
       • Optimized serializer handles Infinityx more requests/sec than Current
       • Optimized serializer handles Infinityx more requests/sec than MikroOrm
       • -Infinity% lower latency compared to Current  serializer

    🔴 Server stopped for 1000 products test


    ======================================================================================================================================================
    📊 COMPREHENSIVE AUTOCANNON LOAD TESTING ANALYSIS
    ======================================================================================================================================================

    🚀 Autocannon Load Testing Scaling Analysis:
    --------------------------------------------------------------------------------------------------------------------------------------------
    Size         RPS (M/O/Op)         Avg Latency (M/O/Op)   P90 Latency (M/O/Op)   Throughput MB/s (M/O/Op)  Speedup vs M (O/Op) Speedup vs O (Op)
    --------------------------------------------------------------------------------------------------------------------------------------------
    10           33.9/821.1/1286.8    319.3/11.7/7.3         327.0/12.0/7.0         31.4/0.2/37.3             24.3x/38.0x        1.6x
    100          3.7/87.5/143.6       3241.3/117.2/70.6      4972.0/116.0/72.0      35.0/0.0/42.2             23.7x/38.9x        1.6x
    1,000        0.0/0.0/13.8         0.0/0.0/792.9          0.0/0.0/755.0          0.0/0.0/41.5              NaNx/Infinityx     Infinityx

    🎯 Overall Load Testing Performance Summary:

       📈 10 products:
          • +56.7% more requests/sec vs Current  (821.1 → 1286.8)
          • +3701.3% more requests/sec vs MikroOrm (33.9 → 1286.8)

       📈 100 products:
          • +64.2% more requests/sec vs Current  (87.5 → 143.6)
          • +3790.5% more requests/sec vs MikroOrm (3.7 → 143.6)

       📈 1000 products:
          • +Infinity% more requests/sec vs Current  (0.0 → 13.8)
          • +Infinity% more requests/sec vs MikroOrm (0.0 → 13.8)
2025-09-22 17:02:10 +00:00
Adrien de Peretti
12a96a7c70 chore(): Move peer deps into a single package and re export from framework (#13439)
* chore(): Move peer deps into a single package and re export from framework

* WIP

* update core packages

* update cli and deps

* update medusa

* update exports path

* remove analyze

* update modules deps

* finalise changes

* fix yarn

* fix import

* Refactor peer dependencies into a single package

Consolidate peer dependencies into one package and re-export from the framework.

* update changeset

* Update .changeset/brown-cows-sleep.md

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* rm deps

* fix deps

* increase timeout

* upgrade version

* update versions

* update versions

* fixes

* update lock

* fix missing import

* fix missing import

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-09-22 18:36:22 +02:00
docloulou
55f89b2151 fix(dashboard): add offset and limit to query parameters in useTableConfiguration (#13565)
This pull request introduces a minor update to the table configuration functionality in the dashboard package. The main change is the addition of pagination support through `offset` and `limit` query parameters.

This fix pagination with `view_configurations:true`

Pagination improvements:

* [`packages/admin/dashboard/src/hooks/table/use-table-configuration.tsx`](diffhunk://#diff-2cf338f1bf284cf3568eabc51107b9a3d51a4b830a81baae2362f608f7c8a55aL71-R71): Updated the `useTableConfiguration` hook to include `offset` and `limit` in the query parameters, enabling pagination for table data.
* [`.changeset/spicy-swans-grab.md`](diffhunk://#diff-1bada2c80b4c3b4ee3c8782ee24ca0183b1bee09aafd7fe130c481152458f1a4R1-R5): Documented the change as a minor update to `@medusajs/dashboard`, specifying the addition of `offset` and `limit` to query parameters in `useTableConfiguration`.
2025-09-22 16:19:59 +00:00
Leonardo Benini
458dd04bbf fix(core-flows,types,medusa): pass /store/shipping-options fields to workflow (#13527)
cc @willbouch since you asked to be tagged if I opened this PR.

The /store/shipping-options is one of only 2 store endpoints to not allow custom `fields` to be passed(other one is /store/returns if you guys want to add it to the backlog). This PR fixes that so that custom linked models can also be retrieved.

Note: This fix reveals a bug in the next.js starter

eac359cc8d/src/lib/data/fulfillment.ts (L23-L24)

`fields` was previously ignored, now it errors since it tries to parse the misspelled "fulfllment"(the i is missing). It worked before since both fields are already defined by default inside the workflow. So the `fields` line is totally redundant and should be removed(ideally before merging this).   
Maybe in the next release notes it should also warn users to remove it for those that already have a modified copy of the starter.
2025-09-22 13:31:59 +00:00
Shahed Nasser
3758303a1d fix(order): save return's location ID from input (#13567) 2025-09-22 13:59:58 +03:00
Adrien de Peretti
9633e0676e fix(workflow-engine-redis): module option queueName wrongly used (#13570)
https://github.com/medusajs/medusa/issues/13452

**What**
Wrongly used module option for redis workflow engine
2025-09-22 10:33:51 +00:00
Adrien de Peretti
92d30b28f4 chore(): remove ssl_mode from url and also use sslmode (#13568)
* chore(): remove ssl_mode from url and also use sslmode

* improve regexp

* chore(): remove ssl_mode from url and also use sslmode

* chore(): remove ssl_mode from url and also use sslmode

* Update SSL mode configuration in changeset

Removed 'ssl_mode' from URL and replaced it with 'sslmode'.
2025-09-22 12:11:43 +02:00
Shahed Nasser
730d73306d chore(medusa): remove empty object type for set cart's customer route (#13549) 2025-09-22 06:22:12 +00:00
Carlos R. L. Rodrigues
68a643bb3a fix(workflow-engine-redis): use worker connection (#13561)
What:
 * Regular redis connection does not have `maxRetriesPerRequest: null`, and the worker connection hangs.
2025-09-22 04:59:59 +00:00
William Bouchard
8a4c10d7f8 fix(types): missing service zone in shipping option (#13559)
* fix(types): missing service zone in shipping option

* Create forty-foxes-live.md
2025-09-21 22:22:10 -04:00
Adrien de Peretti
8ece06d8ed chore(): upgrade mikro orm (#13450) 2025-09-19 21:39:18 +02:00
Adrien de Peretti
4c1c1dd4c0 chore(): Further improve promotions computation (#13556)
* chore(): Further improve promotions

* chore(): Further improve promotions

* chore(): Further improve promotions

* chore(): Further improve promotions

* chore(): Further improve promotions

* Create lazy-lemons-occur.md

* chore(): Further improve promotions

* WIP

* fix

* improve:

* fix attribute tests

* fix tests

* union
2025-09-19 21:34:35 +02:00
Adrien de Peretti
cb716856b6 fix(engine): Always create cleaner job (#13557)
RESOLVES CORE-1206

**What**
Instead of removing cleaner repeatable job and risk to remove it while other instances are still up, we always create it, since the id of a job is unique and we give one to the job, if already present it wont get added
2025-09-19 14:38:14 +00:00
William Bouchard
e5a82518f1 fix(types): pluralize settings (#13558) 2025-09-19 14:35:23 +00:00
Bastien
bb6cc586f7 feat: Add metadata to shipping options endpoints (#13554) 2025-09-19 12:28:20 +02:00
Shahed Nasser
5b7187c261 docs: disable retrieving Cloud pricing data on preview + other changes (#13552)
* docs: disable retrieving Cloud pricing data on preview + other changes

* fixes
2025-09-19 12:40:17 +03:00
Shahed Nasser
2f990a14e6 docs: generate API reference for 2.10.3 (#13548)
* docs: generate API reference for 2.10.3

* fix curl example
2025-09-19 11:40:52 +03:00
Shahed Nasser
0e45249b30 docs: regenerate reference for views changes (#13551) 2025-09-19 10:45:55 +03:00
Shahed Nasser
0fd479f9d6 chore: add since and feature flag TSDocs for setting workflows (#13550) 2025-09-19 10:44:22 +03:00
github-actions[bot]
138e340917 chore(docs): Generated References (automated) (#13544)
Generated the following references:
- `api_key_models`
- `auth_models`
- `cart_models`
- `core_flows`
- `currency_models`
- `customer_models`
- `fulfillment_models`
- `inventory_next_models`
- `js_sdk`
- `modules`
- `order`
- `order_models`
- `payment_models`
- `pricing_models`
- `product_models`
- `promotion_models`
- `region_models`
- `sales_channel_models`
- `stock_location_next_models`
- `store_models`
- `tax_models`
- `types`
- `user_models`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2025-09-19 06:21:46 +00:00
William Bouchard
1fd439e321 fix(medusa-test-utils): add health endpoint in test server (#13546)
* fix(medusa-test-utils): add health endpoint in test server

* Create neat-pumas-promise.md

* comment
2025-09-18 15:17:48 -04:00
github-actions[bot]
c506985737 chore(docs): Update version in documentation (automated) (#13543)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-09-18 19:22:24 +02:00
github-actions[bot]
6866ba963d chore(docs): Generated + Updated UI Reference (automated) (#13542)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-09-18 19:22:09 +02:00
William Bouchard
0695c5844f fix(auth-emailpass): better handle identity with same email error (#13537)
* fix(auth-emailpass): better handle identity with same email error

* add test

* Create blue-laws-argue.md

* check for empty object

* trueeee

* nit

* flip condition
2025-09-18 13:05:54 -04:00
olivermrbl
a503bbe596 chore: Release 2025-09-18 18:42:29 +02:00
github-actions[bot]
174b5b1cb7 chore: Version Packages (#13494)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-18 18:38:07 +02:00