Commit Graph

8972 Commits

Author SHA1 Message Date
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
Sebastian Rindom
41047b3854 feat(dashboard): configurable product views (#13408)
* feat: add a reusable configurable data table

* fix: cleanup

* fix: cleanup

* fix: cache invalidation

* fix: test

* fix: add configurable products

* feat: add configurable product table

* fix: build errors+table style

* fix: sticky header column

* add translations

* fix: cleanup counterenderer

* fix: formatting

* fix: client still skips nulls

* fix: test

* fix: cleanup

* fix: revert client bracket format

* fix: better typing

* fix: add placeholder data to product list
2025-09-18 18:27:17 +02:00
Carlos R. L. Rodrigues
9563ee446f fix(utils,core-flows): subtotal calculation and returns location (#13497)
* fix(utils,core-flows): subtotal calculation and returns location

* changeset

* fix test

* var

* rm extra field from test

* fix original total

* fix partial refunds and pending difference

* fix test

* fix test

* test

* extract to util

* original total and update payment when receive return

* original_subtotal

* default fields

* test

* calculate pending difference

* revert claims test

* pending difference

* creadit line fix

* if
2025-09-18 17:50:40 +02:00
Adrien de Peretti
4736c58da5 fix: Prevent promotion filtering to exceed psql limits (#13540)
* fix(): Prevent promotion filtering to exceed psql limits

* Create sour-rockets-grin.md
2025-09-18 17:50:10 +02:00
Shahed Nasser
aa7ea4d9a6 chore: add tsdocs for latest changes (#13539) 2025-09-18 18:04:24 +03:00
Adrien de Peretti
57897c232e feat(): prefilter top level promotion rules in db (#13524)
* feat(): promotion pre filtering rule from db

* wip

* feat(): promotion pre filtering rule from db

* improve test readability

* resolve conflict

* fix automatic flag

* add index on attribute and operator

* add index on attribute and operator

* finalize

* cleanup

* cleanup

* cleanup

* cleanup

* Create purple-cars-design.md

* fixes

* fixes

* simplify filters

* fix filter

* fix filter

* further improvements

* fixes

* fixes

* fixes

* fix exclusion

* fix comment

* fix comment
2025-09-18 14:34:03 +02:00
Oli Juhl
76497fd40a fix(core-flows): Lock cart on shipping update (#13535) 2025-09-17 21:29:45 +02:00
Adrien de Peretti
c847f7d8bf test(): Try to reproduce automatic promotion adjustments being applied twice (#13533)
**What**
Check that cart update will remove adjustment before creating a new one

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-09-17 18:24:27 +00:00
tehaulp
dcca42ec51 fix(dashboard): added missing currencies (#13214)
Related to #13086, #12440 and #12668

Currencies were added in the migrations, but not in the admin dashboard list, causing admin display errors.

This mod should fix that

Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
2025-09-17 17:34:19 +00:00
William Bouchard
1071296236 feat(core-flows): hook to set shipping opt context when listing (#13468)
* feat(core-flows): add hook to set shipping option context when listing them

* changeset

* add integration test

* add it to other workflow

* missing hook in workflow response

* rework workflow

* rework workflow

* typing issue

* comment from oli

* cursor the goat

* tests

* save lines

* move code around

* missing additional params in many places

* smal fix

* smal fix
2025-09-17 19:20:02 +02:00
Shahed Nasser
def722d8ee docs: improve third-party auth in storefront guide (#13534) 2025-09-17 18:13:54 +03:00
Adrien de Peretti
7de42a69a5 chore(): Shard unit tests jobs (#13525)
* chore(): Shard unit tests jobs

* pass with no tests

* try artifacts

* Revert "try artifacts"

This reverts commit 43663b46ea1fb2d3131182b733ab6e202ea83f1d.
2025-09-17 09:52:58 +02:00
Shahed Nasser
ba9a30757b docs: general improvements (#13530) 2025-09-17 08:48:18 +03:00
Shahed Nasser
1c4f7bd53a docs: fixes to JS SDK + auth provider guides (#13526)
* docs: fixes to JS SDK + auth provider guides

* more fixes

* fix lint error
2025-09-16 18:39:56 +03:00
Shahed Nasser
92102dcafb docs: add Next.js starter guides to llms-full.txt (#13523) 2025-09-16 16:17:07 +03:00
Frane Polić
8565dcfc46 fix(core-flows, medusa): don't allow negative line item quantity (#13508)
* fix(core-flows,medusa): don't allow negative line item quantity

* fix: greater than 0

* feat: add test

* wip: update update item flow to remove item when qty is 0

* fix: paralelize

* fix: when argument

* fix: emit event
2025-09-16 11:54:20 +02:00
Adrien de Peretti
25634b0382 test(): test dynamic max workers and improve CI (#13516)
* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* test(): test dynamic max workers

* Clarify test description and improve CI
2025-09-16 11:11:03 +02:00
Shahed Nasser
b6d96a1b03 docs: small update to invoice generator introduction (#13519) 2025-09-16 09:54:35 +03:00
Shahed Nasser
d4891381fc docs: general improvements and fixes (#13515) 2025-09-16 08:48:27 +03:00
Adrien de Peretti
d9b11b9784 fix(medusa): Use the correct boolean validator (#13510) 2025-09-15 19:17:08 +02:00
Shahed Nasser
4af1815c5b chore: add a link to the storefront docs for cart item totals type (#13514) 2025-09-15 16:18:20 +00:00