Commit Graph

8861 Commits

Author SHA1 Message Date
Adrien de Peretti
a095245d71 chore(): Upgrade mikro orm (#13390)
* chore(): Upgrade mikro orm

* handle 'null' value for big number props

* 6.5.2

* remove only

* fix pricing module rule value

* switch select in strategy for balances

* revert to select in strategy for order module

* fix defining DML ManyToOne

* fix define relationship

* test fix

* more fixes

* change order strategy to balanced

* change order strategy to balanced

* prevent unnecessary manager fork

* revert generated www changes

* remove unnecessary changes

* Create real-cobras-deny.md

* address feedback

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-09-08 21:10:44 +02:00
Adrien de Peretti
fc4d5f0ac9 chore(): Workflow engine timers and notification improvements (#13434)
RESOLVES CORE-1177

**What**
main changes are:
- not blocking execution when notifying
- timers management
- race condition checks improvements
2025-09-08 18:19:55 +00:00
Carlos R. L. Rodrigues
b776fd55dc chore(core-flows): lock on cart operations (#13424)
What:
 - acquire a lock before cart mutations to avoid concurrent changes, e.g applying promotions.
2025-09-08 18:05:09 +00:00
Adrien de Peretti
8e5c22a8e8 chore(): Improve workflows sdk tooling (#13421)
RESOLVES CORE-1171

**What**
 - Reduced async overhead for objects with mixed sync/async properties
 - Lower memory pressure from eliminated promise allocations
 - Faster primitive value processing with early returns
 - Better concurrency through selective batching of truly async operations
 - Event loop friendly behavior preventing artificial delays
 - Reduced memory allocation from eliminated duplicate processing
 - Decreased GC pressure from WeakMap-based caching instead of map

**note**
Now, `resolveValue`always treat every resoltion as sync operation unless it is not, meaning we do not create promise overhead when not necessary and only when actually treating with promises
2025-09-08 16:24:10 +00:00
Oli Juhl
8e11998895 fix(medusa): Use default logger in plugin:develop (#13375)
**What**

Use default logger for plugin command, since there is no `medusa-config.ts` to load the container with (the container that holds the custom logger)
2025-09-08 16:19:42 +00:00
Shahed Nasser
5e1523a206 docs: add graphql dependency to payload guide (#13440) 2025-09-08 19:02:21 +03:00
Shahed Nasser
c01e17a3ef docs: update project creation steps (#13436) 2025-09-08 17:44:32 +03:00
Adrien de Peretti
d7692100e7 chore(orchestration): add support for autoRetry, maxAwaitingRetries, retryStep (#13391)
RESOLVES CORE-1163
RESOLVES CORE-1164

**What**

### Add support for non auto retryable steps.

When marking a step with `maxRetries`, when it will fail it will be marked as temporary failure and then retry itself automatically. Thats the default behaviour, if you now add `autoRetry: false`, when the step will fail it will be marked as temporary failure but not retry automatically. you can now call the workflow engine run to resume the workflow from the failing step to be retried.

### Add support for `maxAwaitingRetries`

When setting `retyIntervalAwaiting` a step that is awaiting will be retried after the specified interval without maximun retry. Now you can set `maxAwaitingRetries` to force a maximum awaiting retry number

### Add support to manually retry an awaiting step

In some scenario, either a machine dies while a step is executing or a step is taking longer than expected, you can now call `retryStep` on the workflow engine to force a retry of the step that is supposedly stucked
2025-09-08 12:46:30 +00:00
Shahed Nasser
ac5e23b96c docs: fixes and improvements to price calculation guide (#13419) 2025-09-08 09:47:54 +03:00
0xFl4g
a0693727a0 fix(medusa-test-utils): add DB_PORT env variable support (#12782)
* fix(medusa-test-utils): add DB_PORT environment variable support

- Add DB_PORT constant with default value "5432"
- Update pgGodCredentials to include port property
- Modify getDatabaseURL to include port in connection string
- Allows custom PostgreSQL port configuration via DB_PORT env var

* chore: add changeset for DB_PORT support

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-09-07 22:47:53 +02:00
Patryk Spychalski
ca471eb8f4 feat: Add return type in createPaymentCollectionForCartWorkflow (#13385)
* return created payment collection in createPaymentCollectionForCartWorkflow

* changeset

* Update .changeset/tasty-ghosts-work.md

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>

* declare return type

* return single payment collection instead of array

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
2025-09-07 19:24:09 +02:00
Carlos R. L. Rodrigues
71d8a0031f fix(index): index enum fields (#13428)
https://github.com/medusajs/medusa/issues/13372

What:
 - It handles enum fields corretly when added to filterable fields
2025-09-07 13:39:58 +00:00
Oli Juhl
637d4cf7ef fix: Missing DB traces in instrumentation (#13429)
* chore: Fix issue with missing DB traces

* Fix missing DB traces in Medusa package

Fixes an issue related to missing database traces in the Medusa package.
2025-09-07 15:04:15 +02:00
Adrien de Peretti
2fe68a975b chore(): Improve some cart operation flows to remove extraneous operations when not required (#13418)
RESOLVES CORE-1155

**What**
- prevent update payment collection worklow to fetch data and call steps when there is no payment collection
- prevent refresh Cart Shipping Methods Workflow to fetch data and call steps when there is no shipping methods
- update promotion step to remove extraneous module call
2025-09-07 12:52:36 +00:00
William Bouchard
9b3831d258 fix(dashboard): support more decimals for tx rates (#13407)
* Percentage formatter set maximum digits to 4

* Modify Tax Region Forms to allow 4 digits tax rates

* Add changeset

* Revert placeholder value to use only 2 decimals

* fix(dashboard): support more decimals for tx rates

* changeset

* bypass scale

* refactor

* fix removal of deprecated input

* cleanup deprecated percentage input

* small mistake in onchange

* add deprecated percentage input back

* import

* remove file extension

* frane comment

---------

Co-authored-by: AmbroziuBaban <ambroziubaban@gmail.com>
2025-09-05 13:02:44 +02:00
Frane Polić
0000ed6998 fix(draft-order, medusa, types): ui polish (#13376)
**What**
- ensure unique promotion changes are displayed in the activity section
- check linked promotions by id and not code
- list promotions - add id param
- make address payload fields nullish
- Add items view UI tweaks

---

CLOSES SUP-2400
2025-09-05 06:55:07 +00:00
Frane Polić
e67974ffe5 fix(dashboard): customer has_acccount flag (#13414) 2025-09-05 08:01:29 +02:00
Shahed Nasser
1fcec15ef5 docs: add plan cancelation details (#13416)
* docs: add plan cancelation details

* fix link

* fix link
2025-09-04 19:39:27 +03:00
Shahed Nasser
8785fb4e1a docs: general fixes and improvements (#13417) 2025-09-04 19:27:34 +03:00
Adrien de Peretti
55a35e4721 chore(workflows-sdk, utils): Prevent unnecessary serialization (#13413)
* chore(workflows-sdk, utils): Prevent unnecessary serialization

* Create poor-mugs-cheat.md
2025-09-04 16:19:35 +02:00
Carlos R. L. Rodrigues
bd571aca82 chore(orchestration): remote joiner query planner (#13364)
What:
 - Added query planning to the Remote Joiner, enabling phased and parallel execution of data aggregation.
- Replaced object deletes with non-enumerable property hiding to improve performance.
2025-09-04 14:18:02 +00:00
Frane Polić
b7fef5b7ef fix(dashboard): promotion decimal value definition (#13371)
* fix(dashboard): pormotion decimal value definition

* fix: typo

* fix: fixed value decimals

* fix: translation
2025-09-04 16:07:29 +02:00
Shahed Nasser
21c31a2ab2 docs: added a note about payload version (#13410) 2025-09-04 14:25:09 +03:00
Adrien de Peretti
2b89510df3 chore(): only execute race execution checks and publish message only for async workflows (#13396)
* chore(): only execute race execution checks for async workflows

* chore(): workflow redis publish only for async flows

* Create cyan-gorillas-poke.md

* chore(): workflow redis publish only for async flows

* fix negative check

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-09-04 09:12:09 +02:00
Shahed Nasser
28830567e7 docs: fix scrollbar not clickable (#13409) 2025-09-04 09:55:38 +03:00
Frane Polić
f69088998c fix(dashboard, ui): ensure radix deps version (#13392) 2025-09-04 08:42:51 +02:00
William Bouchard
faae150a58 fix(utils): big bumber should give numeric value of 0 for small numbers (#13394)
* fix(utils): big bumber should give numeric value of 0 for small numbers

* circular dep

* fix imports

* fix infinite loop

* fix test

* changeset
2025-09-03 13:45:41 -04:00
Oli Juhl
115a1deb49 chore: Fix scripts in CLI pipeline (#13402)
* chore: Fix scripts in CLI pipeline

* Create curly-lizards-dress.md
2025-09-03 14:07:24 +02:00
Nicklas Gellner
a2dabea6c4 docs: change text in Cloud homepage (#13401) 2025-09-03 09:32:16 +00:00
Shahed Nasser
f1149ea170 docs: show the source code link in order models reference (#13398) 2025-09-03 10:36:59 +03:00
Shahed Nasser
1578e1ad22 docs: add more examples for API route responses (#13399) 2025-09-03 10:36:24 +03:00
William Bouchard
2f6edf367a feat(dashboard,cart,types,utils): refine order details summary (#13313)
* feat(dashboard,types,utils): refine order details summary

* fix tests

* changeset

* ui corrections

* tests again

* weird tests failing

* revert update to subtotal

* revert http tests too

* comments

* move credit lines so it makes more sense

* remove currency codes and add bold prices

* add new properties in default for storefront

* minor to patch

* remove bold on things that should be

* olis comment about taxes

* remove bold from shipping
2025-09-02 20:50:37 +02:00
Pepijn
753e8081c4 fix(dashboard): promotion expired status check when limit is null (#13373)
* Fix promotion expired status

* Update .changeset/bright-spoons-float.md

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

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-09-02 11:46:32 +02:00
Shahed Nasser
e96c0e4d09 docs: document feature flags (#13388) 2025-09-02 12:26:54 +03:00
Adrien de Peretti
bd206cb250 chore(): improve workflow engine storage (#13345)
* chore(workflow-engines): Improve race condition management

* cleanup

* cleanup

* chore(workflow-engines): Improve race condition management

* chore(workflow-engines): Improve race condition management

* chore(workflow-engines): heartbeat extend TTL

* Refactor chore title for workflow engine improvements

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* chore(): Improve workflow execution db interaction

* update tests

* revert idempotent

* add run_id index + await deletion

* improve saving

* comment

* remove only

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-09-02 11:18:12 +02:00
Adrien de Peretti
b85a46e85b chore(): faster serialization (#13325)
* chore(): Improve serialization perf

* better optimization with monomorphic approach and consistent object shape and array operations

* cleanup

* cleanup

* fix

* Create short-birds-help.md

* ref work

* ref work

* address feedback

* save intermediary changes

* save intermediary changes
2025-09-02 10:19:59 +02:00
Frane Polić
fb71bc6405 fix(core-flows): handle cacluated shipping options on draft orders gracefully (#13353)
* fix(core-flows): handle calculated shipping options on draft orders gracefully

* fix: throw medusa error
2025-09-02 10:06:31 +02:00
Leroy Davidson Descelles
e6c394569e docs: change digial products to digital products (#13379)
Small fix for typo I noticed when reading the docs.
2025-09-02 06:29:43 +00:00
Shahed Nasser
24199fa47a docs: general updates and fixes (#13374)
* docs: general updates and fixes

* fix lint errors
2025-09-02 09:07:07 +03:00
Sebastian Rindom
c717535ca2 feat(admin): add configurable order views (#13211)
Adds support for configurable order views.

https://github.com/user-attachments/assets/ed4a5f61-1667-4ed7-9478-423894f3eba6
2025-09-01 17:04:18 +00:00
Shahed Nasser
f8d8eeace1 docs: added a section on figma mcp + workflows diagram fix (#13367) 2025-09-01 18:45:23 +03:00
Shahed Nasser
bafe110352 docs: add missing step in product builder guide (#13370) 2025-09-01 18:42:35 +03:00
Carlos R. L. Rodrigues
b4c0f131b7 chore(framework,medusa): load custom flags before medusa config (#13312)
* chore(framework,medusa): load custom flags before medusa config

* test

* test runner

* changeset

* check manager featureFlags

* discover and register flags

* rm comments

* update changeset

* changeset

* use local cli

* execute from local medusa command

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-09-01 16:04:43 +02:00
Sebastian Rindom
2a94dbd243 feat(ui): add column visibility and drag-and-drop reordering support (#13198) 2025-09-01 12:03:56 +00:00
Sebastian Rindom
5a46372afd Feat/datatable core enhancements (#13193)
**What**

This PR adds core DataTable enhancements to support view configurations in the admin dashboard. This is part of a set of stacked PRs to add the feature to Medusa.

- Puts handlers in place to update the visible columns in a table and the order in which they appear.
- Adds a ViewPills component for displaying and switching between saved view configurations
- Integrated view configuration hooks (useViewConfigurations) with the DataTable

Note: Column drag-and-drop reordering and the column visibility UI controls are not included in this PR as they require additional UI library updates - which will come in the next PR.

Example of what this looks like with the feature flag turned on - note the view pills with "default" in the top. This will expand when the data table behavior adds configuration.
<img width="2492" height="758" alt="CleanShot 2025-08-13 at 2  31 35@2x" src="https://github.com/user-attachments/assets/ee770f1c-dae1-49da-b255-1a6d615789de" />
2025-09-01 10:30:05 +00:00
Sebastian Rindom
fa10c78ed3 feat(admin): add view configuration client infrastructure (#13186)
This is part of stacked PRs to add a view configuration feature which will allow users to customize the columns seen in tables in the Medusa Admin dashboard.

**What**
- Adds client providers, sdk methods and hooks for interacting with the views api.
2025-09-01 09:20:37 +00:00
Shahed Nasser
72675c59ec docs: document how prices are stored in Medusa (#13362) 2025-09-01 10:10:28 +03:00
Shahed Nasser
c71ad3ff61 docs: add locking module provider to deployment guide (#13361) 2025-09-01 10:09:55 +03:00
Riqwan Thamir
ca038ff583 feat(promotion): Allow buyget promotion to apply multiple times on cart (#13305)
what:

Introduces 2 new features to promotion module:

1. Introduce max quantity limit to promotion application - This will limit the application of the promotion based on the quantity of the target products in the cart. 
2. When applying buy get promotions, we will now apply buyget promotion until eligible items are exhausted or max quantity is reached. 

```
- Buy 2 t-shirts, Get 1 sweater
- Max quantity -> 1

This means you can add two t-shirts, and get 1 sweaters for free. However, if you add four t-shirts, you only get one sweater for free.
```

```
- Buy 2 t-shirts, Get 1 sweater
- Max quantity -> 3

This means you can add six t-shirts, and get three sweaters for free. However, if you add eight t-shirts, you only get three sweaters for free
```

```
- Buy 4 t-shirts, Get 2 sweater
- Max quantity -> 1

This should throw on creation, as the max quantity should as a minimum be the same value as the target rule quantity
```

RESOLVES SUP-2357 / https://github.com/medusajs/medusa/issues/13265
2025-08-31 13:35:36 +00:00
Frane Polić
f53f027ce6 fix(dashboard): rules form operator change (#13324)
**What**
- fix condition rules form sometimes rendering multi and single selects unrelated to the attribute operator selected
- reset rule value when operator is changed
- disable selecting rule values untill operator is selected
- translate labels
2025-08-29 15:53:00 +00:00