Commit Graph

5965 Commits

Author SHA1 Message Date
Adrien de Peretti
fe49b567d6 chore: Backend HMR (expriemental) (#14074)
**What**

 This PR introduces experimental Hot Module Replacement (HMR) for the Medusa backend, enabling developers to see code changes reflected immediately without restarting the server. This significantly improves the development experience by reducing iteration time.

### Key Features

  - Hot reload support for:
    - API Routes
    - Workflows & Steps
    - Scheduled Jobs
    - Event Subscribers
    - Modules
  - IPC-based architecture: The dev server runs in a child process, communicating with the parent watcher via IPC. When HMR fails, the child process is killed and restarted, ensuring
  clean resource cleanup.
  - Recovery mechanism: Automatically recovers from broken module states without manual intervention.
  - Graceful fallback: When HMR cannot handle a change (e.g., medusa-config.ts, .env), the server restarts completely.


### Architecture
```mermaid
  flowchart TB
      subgraph Parent["develop.ts (File Watcher)"]
          W[Watch Files]
      end

      subgraph Child["start.ts (HTTP Server)"]
          R[reloadResources]
          R --> MR[ModuleReloader]
          R --> WR[WorkflowReloader]
          R --> RR[RouteReloader]
          R --> SR[SubscriberReloader]
          R --> JR[JobReloader]
      end

      W -->|"hmr-reload"| R
      R -->|"hmr-result"| W
```

### How to enable it

Backend HMR is behind a feature flag. Enable it by setting:

```ts
  // medusa-config.ts
  module.exports = defineConfig({
    featureFlags: {
      backend_hmr: true
    }
  })
```

or

```bash
export MEDUSA_FF_BACKEND_HMR=true
```

or

```
// .env
MEDUSA_FF_BACKEND_HMR=true
```

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-12-08 08:48:36 +00:00
Nicolas Gorga
4de555b546 fix(medusa): use customer query config on delete address route (#14238)
* Use customer query config when deleting address

* Add changeset
2025-12-08 09:11:55 +01:00
Shahed Nasser
b517137466 fix(utils): fix error when generating migrations for a module with existing snapshot (#14218) 2025-12-08 08:54:32 +02:00
Nicolas Gorga
9e4d2df72f fix(dashboard): avoid unnecessary product relations to be returned by default (#14175)
## Summary

**What** — What changes are introduced in this PR?

Improve Admin UI product detail performance after updating the entity.

**Why** — Why are these changes relevant or necessary?  

Products with a lot of relations would cause issues when trying to be updated through various edit components, since the core update api route returns these entities by default.

**How** — How have these changes been implemented?

We remove these unnecessary relations when calling the update route, by passing the `fields` query param with the negation sign for each of these. For example: `fields=-type,-collection...`

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

Tested all of the update components and validated they still work correctly, plus, none depend on the returned product to perform an action or render information.

---

## 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.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] 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**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.

fixes #13783, #14183
closes CORE-1296, SUP-2791


Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2025-12-07 19:03:25 +00:00
Nicolas Gorga
842c0f5007 fix(core-flows): refresh payment collection inside updateCartPromotionsWorkflow (#13963)
* Refresh payment collection after cart promotion update

* Add missing test

* Add changeset

* Update changeset

* Add force_refresh_payment_collection to updateCartPromotionsWorkflow to conditionally refresh payment collection

* Prevent refreshing payment collection multiple times

* Fix test

* Formatting and unused vars

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2025-12-05 15:27:21 -03:00
Adrien de Peretti
144f0f4e2e chore(event-bus, workflow-engine): Enable more granualar queues configuration (#14201)
Summary

  This PR adds BullMQ queue and worker configuration options to the workflow-engine-redis module, bringing feature parity with the event-bus-redis module. It also introduces per-queue
  configuration options for fine-grained control over the three internal queues (main, job, and cleaner).

  Key changes:
  - Added per-queue BullMQ configuration options (mainQueueOptions, jobQueueOptions, cleanerQueueOptions and their worker counterparts) with shared defaults
  - Unified Redis option naming across modules: deprecated url → redisUrl, options → redisOptions (with backward compatibility)
  - Moved configuration resolution to the loader and registered options in the DI container
  - Added comprehensive JSDoc documentation for all configuration options
  - Added unit tests for option merging and queue/worker configuration

  Configuration Example

```ts
  // Simple configuration - same options for all queues
  {
    redisUrl: "redis://localhost:6379",
    queueOptions: { defaultJobOptions: { removeOnComplete: 1000 } },
    workerOptions: { concurrency: 10 }
  }
```

```ts
  // Advanced configuration - per-queue overrides
  {
    redisUrl: "redis://localhost:6379",
    workerOptions: { concurrency: 10 },        // shared default
    jobWorkerOptions: { concurrency: 5 },      // override for scheduled workflows
    cleanerWorkerOptions: { concurrency: 1 }   // override for cleanup (low priority)
  }
```
2025-12-05 12:03:12 +00:00
Nicolas Gorga
3e3e6c37bd fix(dashboard): show correct color indicators for payment and fulfillment status columns for view_configuration feature flag (#14215)
## Summary

**What** — What changes are introduced in this PR?

Show correct color indicator for payment and fulfillment status columns when `view_configuration` feature flag is enabled on order data table.

**Why** — Why are these changes relevant or necessary?  

For non canceled status, grey default indicator was shown, as these columns weren't handled with their dedicated helper functions.

**How** — How have these changes been implemented?

Updated `StatusRenderer` to resolve the label and color for these columns with their helper functions, just like we do for the normal order table.

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

Validated Admin UI shows correct color indicators when `view_configuration` is enabled.

---

## 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.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] 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**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.

closes CORE-1309
2025-12-05 11:59:34 +00:00
Adrien de Peretti
24c469d217 chore(): Run some commands in server mode only (#14202)
* chore(): Run some commands in server mode only

* Create orange-timers-lay.md

* chore(): Run some commands in server mode only

* chore(): Run some commands in server mode only

* chore(): Run some commands in server mode only
2025-12-05 12:55:23 +01:00
Nicolas Gorga
008f5bb47d feat(dashboard): Improve fully refunded order details (#14077)
## Summary

**What** — What changes are introduced in this PR?

Improve fully refunded order details in the order list of Admin UI.

**Why** — Why are these changes relevant or necessary?  

Fully refunded orders did not show a value for the `total` column and its `payment_status` color badge expressed a happy path.

**How** — How have these changes been implemented?

Added the refund amount with line through style for fully refunded orders in the `total` column of order list table and changed the `payment_status` badge color to red

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

Validated UI looks as expected

---

## 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.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] 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**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.


---

> [!NOTE]
> Show refunded amounts with muted strikethrough in the total column for fully refunded orders and set the refunded payment badge to red, fetching `payment_collections` as needed.
> 
> - **Admin Dashboard — Order List**:
>   - **Total column**: For `payment_status === "refunded"`, display the sum of `payment_collections.refunded_amount` with `text-ui-fg-muted` and `line-through` via `TotalCell` `className`.
>   - **Payment status**: Change `refunded` badge color to red.
>   - **Component**: `TotalCell` now accepts optional `className`.
> - **Data**:
>   - Add `*payment_collections` to `DEFAULT_RELATIONS` for orders.
> - **Changeset**:
>   - Patch release for `@medusajs/dashboard`.
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 802d24330bceaeba74e11d85886593809876cd8d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2025-12-05 09:20:45 +00:00
Pedro Guzman
56ed9cf9f7 fix S3 URL escaping (#14220) 2025-12-04 22:03:17 +01:00
Pedro Guzman
b7adfb225b fix: escape non-ascii characters in filenames in s3 file provider (#14209)
* escape non-ascii characters in filenames in s3 file provider

* fix url encoding
2025-12-04 18:37:56 +01:00
Carlos R. L. Rodrigues
5b7e3c0e76 chore: configurable database migration in concurrency (#14004)
> [!NOTE]
> Adds a configurable concurrency for link migrations (CLI/commands), forces concurrency=1 when pgstream is detected, and ignores duplicate link-table inserts.
> 
> - **CLI**
>   - Add `--concurrency` option to `db:migrate` and `db:sync-links`.
> - **Medusa commands**
>   - `migrate` and `sync-links` accept `concurrency`; set `DB_MIGRATION_CONCURRENCY` and force `1` when `pgstream` schema exists via new `isPgstreamEnabled`.
> - **Link Modules (migrations)**
>   - Execute plan actions with `executeWithConcurrency` using `DB_MIGRATION_CONCURRENCY`.
>   - Make link-table tracking inserts idempotent with `ON CONFLICT DO NOTHING` (including bulk/upsert and per-create).
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 07432293c8fe8de30b07920fa47823b9081edacc. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2025-12-04 11:30:30 +00:00
Adrien de Peretti
9f7846ae0b chore(): revert route loading parallelization (#14204)
**What**
To prevent undeterministic route loading, remove route loading concurrency
2025-12-03 13:54:31 +00:00
olivermrbl
ba275a33bb chore: Version packages 2025-12-03 09:20:02 +01:00
Adrien de Peretti
391d8dc6cd fix(): event emitting (#14196)
* fix(): event emitting

* Create rude-queens-deny.md

* fix(): store subscriber should not be constraint

* Update rude-queens-deny.md

* Add tests to prevent regression
2025-12-03 08:53:09 +01:00
Nicolas Gorga
ef162f8b5f fix(order): Add composite unique index on order_item version:item_id (#14164)
* Unique index on order_item version:item_id

* Add changeset
2025-12-02 08:55:25 -03:00
Shahed Nasser
92769b2b1c chore: fixes to TSDocs (#14186)
* chore: fixes to TSDocs

* update comments for auth provider
2025-12-02 11:57:04 +02:00
olivermrbl
1d4af32749 chore: Version packages 2025-12-01 18:54:07 +01:00
Frane Polić
8ddf8b4d76 fix: skip promotion usage limit checks on edit flows (#14176)
* fix: skip promotion usage limit checks on edit flows

* feat: add test check
2025-12-01 18:29:15 +01:00
Adrien de Peretti
0f835381e9 fix(product): Update performance issue (#14150)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-12-01 16:45:18 +01:00
Shahed Nasser
3cf1e5e9de chore: change 2.11.4 to 2.12.0 in TSDocs (#14174) 2025-12-01 17:33:28 +02:00
Pepijn
83dd1b616a chore: Add missing order metadata for create fulfillment (#14028)
* Add missing order metadata for create fulfillment

* Update .changeset/blue-olives-wave.md

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>

---------

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2025-12-01 16:18:40 +01:00
Adil Basri
8f1b97898b fix(dashboard): enable sorting by default based on apiColumn state (#14167)
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-12-01 16:17:51 +01:00
Frane Polić
b74ef4a784 fix(fulfillment): make relationship between SO and SO type M:1 (#14061)
* fix(fulfillment): make relationship between SO and SO type M:1

* fix: test and types, remap type id to existing column

* Fix typo

* Fix typo

* chore: update changeset

* fix: typo

---------

Co-authored-by: Nicolas Gorga <62995075+NicolasGorga@users.noreply.github.com>
2025-12-01 16:16:29 +01:00
Pepijn
6bc5bf4fc9 Fix not in promotion rule empty value validation (#14172) 2025-12-01 15:04:57 +01:00
Shahed Nasser
ee1be833c3 chore: improve completeCartWorkflow TSDocs (#14153)
* chore: improve completeCartWorkflow TSDocs

* small improvement
2025-12-01 14:20:07 +02:00
Nicolas Gorga
3e2991e447 fix(core-flows): create reservations on draft order conversion to regular order (#14010)
## Summary

**What** — What changes are introduced in this PR?

Avoid creating reservations when draft order edits are confirmed and rather, create them when the draft order is converted into a regular order.

**Why** — Why are these changes relevant or necessary?  

While the order is a draft, creating reservations would potentially block inventory for regular order requests, when the draft represents a non materialized state of a purchase that might never be completed or at a latter point in time.

**How** — How have these changes been implemented?

Removed the reservation creations inside of `confirmDraftOrderEditWorkflow` and instead do it inside `convertDraftOrderWorkflow`

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

Added 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.

```ts
// Example usage
```

---

## Checklist

Please ensure the following before requesting a review:

- [x] 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
- [x] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [x] I have linked the related issue(s) if applicable

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.

fixes #13773 
closes SUP-2523
2025-12-01 12:08:03 +00:00
Shahed Nasser
73ae136965 chore: improve and add TSDocs for next release (#14170) 2025-12-01 13:41:31 +02:00
Shahed Nasser
00aa2c13bc fix(js-sdk,types,medusa): add HTTP types for update order change API route (#14169)
## Summary

**What** — What changes are introduced in this PR?

- Add HTTP type for update order API route payload + use it in the JS SDK and API route
- other: add `since` tag

**Why** — Why are these changes relevant or necessary?  

*Please provide answer here*

**How** — How have these changes been implemented?

*Please provide answer here*

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

*Please provide answer here*

---

## 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.

```ts
// 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

Add any additional context, related issues, or references that might help the reviewer understand this PR.
2025-12-01 11:28:08 +00:00
Adrien de Peretti
bbf294fc31 chore: Update medusa exec worker mode (#14145)
* chore: Update medusa exec worker mode

* chore: Update medusa exec worker mode

* Create cuddly-numbers-camp.md
2025-11-30 19:44:54 +01:00
Frane Polić
536a3f802c feat: promotion usage limit (#13760)
* feat: promotion usage limit

* fix: update, refactor tests, parallel case

* fix: batch update, cleanup unused map

* feat: paralel campaign and promotion tests

* chore: changesets, fix i18 schema

* fix: ui tweaks

* chore: refactor

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-11-30 19:43:36 +01:00
Frane Polić
5da51064d7 feat: carry over promotions toggle on exchanges (#14128)
* feat: carry over promotions toggle on exchanges

* fix: inital flag value, return the flag on preview

* fix: validation of allocation type

* fix: revert client changes

* fix: invert condition

* feat: recompute adjustments when outbound item is updated

* fix: condition again

* fix: display more accurate inbound/outbound totals for exchanges

* fix: make exchanges specs green

* feat: more testing cases

* wip: pr feedback

* fix: use plural for the flag on Admin

* fix: schema test, route refactor

* feat: tooltip

* feat: refactor to use update workflow

* feat: display applied promotion per item on order details, show copy sku on hover

* feat: refactor edits and exchanges to have common flag toggle flow

* fix: delete empty file

* fix: exchange_id param query
2025-11-30 19:31:31 +01:00
Adrien de Peretti
91499081f4 chore(): Promotion auto managed joiner config (#14115)
* chore(): Promotion auto managed joiner config

* Create light-trainers-tie.md

* chore(): align tests expectactions
2025-11-27 12:45:17 +01:00
Adrien de Peretti
6057afdfaa chore(): Add new regression tests to the remote joiner (#14119)
* Add tests

* Add tests

* Add tests
2025-11-27 09:31:25 +01:00
Shahed Nasser
e8990133e5 chore: fix payloads of events in TSDocs + description of emitEventStep (#14132) 2025-11-26 18:00:21 +02:00
Frane Polić
1e761345be feat(dashboard): show promo tooltip on the edit flows (#14121)
## Summary

**What** — What changes are introduced in this PR?

Display a tootlipt on line items when creating OrderEdit/Exchange to show which promotions are applied on the items.

---

## Checklist

Please ensure the following before requesting a review:

- [x] 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**
- [x] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable

<img width="786" height="910" alt="Screenshot 2025-11-25 at 14 11 22" src="https://github.com/user-attachments/assets/644bea00-b8ab-4a70-9a43-7c912ac21208" />

<img width="775" height="792" alt="Screenshot 2025-11-25 at 14 23 26" src="https://github.com/user-attachments/assets/ed935dad-9c2b-4ebd-8b9f-00d929add1ff" />
2025-11-25 19:37:45 +00:00
Adrien de Peretti
1cfc88ee55 chore(): Improve product list when there is a single sales channel (#14082)
FIXES https://github.com/medusajs/medusa/issues/13976

**What**
Before applying the sales channel link filter, check if there is a single sales channel or many, if will add a bit of overhead but marginal compare to the improvement for big catalog with single sales channel


---

> [!NOTE]
> Optimizes store products listing by conditionally skipping sales channel link filtering when the index can be used or only one sales channel exists.
> 
> - **Store API – `products`** (`packages/medusa/src/api/store/products/middlewares.ts`):
>   - Adds `applyMaybeLinkFilterIfNecessary` middleware:
>     - Skips link filtering when `IndexEngine` is enabled and no tag/category filters are present.
>     - Queries `sales_channels` count; if only one exists, removes `sales_channel_id` filter and proceeds.
>   - Integrates this middleware into `GET /store/products` before default filters; `GET /store/products/:id` remains unchanged with `maybeApplyLinkFilter`.
> - **Release**:
>   - Adds patch changeset for `@medusajs/medusa`.
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8a0b024ea1bc9696f350f34fa77df321e5ecf553. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2025-11-25 10:45:38 +00:00
Carlos R. L. Rodrigues
5725837ba8 fix(orchestration): fetch fields from link entities (#14097)
* fix(orchestration): fetch fields from link entities

* args
2025-11-25 11:35:05 +01:00
Nicolas Gorga
0e73d8d5e3 fix(core-flows): lock mark as delivered fulfillment/order flows (#14111)
* Lock markFulfillmentAsDeliveredWorkflow with fulifllment id

* Lock markOrderFulfillmentAsDeliveredWorkflow by orderId before calling markFulfillmentAsDeliveredWorkflow

* Add changeset
2025-11-25 06:56:10 -03:00
Oli Juhl
78842af1c3 fix: Compute "virtual" adjustments for order previews (#13306)
* wip

* add wip

* wip

* reuse action

* finish first draft

* fix tests

* cleanup

* Only compute adjustments when necessary

* Create hot-carrots-look.md

* address comments

* minor tweaks

* fix pay col

* fix test

* wip

* Dwip

* wip

* fix: adjustment typo

* fix: import

* fix: workflow imports

* wip: update test

* feat: upsert versioned  adjustments when previewing order

* fix: revert unique codes change

* fix: order spec test with versioning

* wip: save

* feat: make adjustments work for preview and confirm flow, wip base repo filtering of older version adjustments

* fix: missing populate where

* wip: populate where loading versioned adjustments

* fix: filter out older adjustment versions

* temp: comment adjustments in repo

* test: add adjustment if no version

* wip: configure populate where in order base repository

* fix: rm manual filtering

* fix: revert base repo changes

* fix: revert

* fix: use order item version instead of order version

* fix: rm only in test

* fix: update case spec

* fix: remove sceanrio, wip test with draft promotion

* feat: test correct adjustments when disabling promotion

* feat: complex test case

* feat: test consecutive order edits

* feat: 2 promotions test case with a fixed promo

* feat: migrate existing order line item adjustments to order items latest version

* feat: update dep after merge

* wip: load adjustments separatley

* feat: adjustments collections

* fix: spread result, handle related entity case

* fix: update lock

* feat: make sure version is loaded, refactor, handle related entity case

* fix: check fields

* feat: loading adjustments for list and count

* fix: correct items version field

* fix: rm empty array

* fix: wip order modules spec

* fix: order module specs

* feat: preinit items adjustments

* fix: rm only

* fix: rm only

* chore: cleanup

* fix: migration files

* fix: dont change formatting

* fix: core package build

* chore: more cleanup

* fix: item update util

* fix: duplicate import

* fix: refresh adjustments for exchanges (#13992)

* wip: exchange adjustments

* feat: test - receive items

* feat: finish test case

* fix: casing

* fix(draft-orders, core-flows, orders) refresh adjustments for draft orders (#14025)

* wip: draft orders adjustments refresh

* feat: rewrite to use REPLACE action + test

* fix: rm only

* feat: cleanup old REPLACE actions

* feat: cleanup adjustemnts when 0 promotions

* wip: canceling draft order

* fix: make version arg optional

* fix: restore promotion links

* feat: test reverting on cancelation

* fix: address comments in tests

* wip: fix summary on preview

* fix: get pending diff on preview summary from total

* fix: revert pending diff change

---------

Co-authored-by: fPolic <mainacc.polic@gmail.com>
Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2025-11-25 10:41:14 +01:00
Shahed Nasser
0ddd9e36b5 fix(product): add missing decorators to updateProductOptionValues method (#14060) 2025-11-25 11:02:21 +02:00
Pedro Guzman
b81f958d41 Add provider data to notifications (#14104)
## Summary

**What** —
Add a providerData field to notifications

**Why** —
We need the ability to pass dynamic fields to specific providers. E.g. CC and BCC for emails

**How** —
Just adding the field to the model

**Testing** —
Added the field to existing tests

## Checklist

Please ensure the following before requesting a review:

- [x] 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
- [x] The changes are covered by relevant **tests**
- [x] I have verified the code works as intended locally
- [ ] I have linked the related issue(s) if applicable



---

> [!NOTE]
> Adds `provider_data` to notifications (types, workflow input, DB model/migration) and forwards it in the Medusa Cloud Email provider, with tests updated accordingly.
> 
> - **Data/Schema**:
>   - Add `provider_data` (`jsonb`) to `notification` model and DB via migration `Migration20251121150408` and snapshot update.
> - **Types/DTOs**:
>   - Add optional `provider_data` to `CreateNotificationDTO`, `NotificationDTO`, and `ProviderSendNotificationDTO`.
> - **Workflows**:
>   - Extend `send-notifications` step input with `provider_data`.
> - **Providers**:
>   - Medusa Cloud Email: include `provider_data` in outgoing request payload.
> - **Tests**:
>   - Update integration tests to pass and assert `provider_data` propagation.
> - **Changeset**:
>   - Patch bumps for `@medusajs/notification`, `@medusajs/core-flows`, `@medusajs/types`.
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6f114c75c974a145ef60213637d7c41bc605a0bf. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
2025-11-24 09:18:47 +00:00
Adrien de Peretti
113f200a99 chore(event-bus-*): Do not emit if no subscribers: (#14084)
* chore(event-vus-*): Do not emit if no subscribers:

* Create curly-apricots-double.md

* add tests

* align tests
2025-11-24 09:36:52 +01:00
Adrien de Peretti
6c3ec528f1 fix(): Workflow engine redis worker instance in worker mode (#14099)
* fix(): Workflow engine redis worker instance in worker mode

* Create wicked-tips-buy.md
2025-11-24 09:31:36 +01:00
Pedro Guzman
f67bfb9f92 add from to notification model (#14102) 2025-11-24 09:24:38 +01:00
Nicolas Gorga
0cb12021ef fix(core-flows): Add discountable properties in queried fields to avoid overriding discountable properties when set (#14105)
* Add discountable properties to avoid applying adjustments to non discountable line items

* Add changeset
2025-11-24 09:24:24 +01:00
Nicolas Gorga
79582bc94e fix(core-flows): prevent completing cart from webhook when order already exists (#14108)
* Prevent completing cart when order already exists in processPaymentWorkflow

* Add tests

* Add changeset
2025-11-24 09:23:39 +01:00
Nicolas Gorga
32eaa9dd81 fix(medusa): avoid throwing on error on set step failure endpoint (#14066)
* Avoid throwing on setStepFailure endpoint

* Add changeset

* Add tests
2025-11-23 07:04:39 -03:00
Adrien de Peretti
beb91d88a2 chore(): Update glob package (#14083)
* chore(): Update glob package

* Create fresh-needles-wave.md
2025-11-19 21:53:32 +01:00
Nathan John
929607f692 fix(fulfillment) Variants changed from managed inventory to unmanaged are now fulfillable (#14056)
* (fix) Variants changed from managed inventory to unmanaged are now fulfillable

* Changeset

* Update dull-donkeys-ring.md
2025-11-19 17:01:36 +01:00