Commit Graph

9138 Commits

Author SHA1 Message Date
Shahed Nasser
1d3231d37a docs: fixes to docker installation guide (#13847)
* docs: fixes to docker installation guide

* more fixes

* re-organize troubleshooting

* add title
2025-10-24 12:18:36 +03:00
Shahed Nasser
7c31276f98 docs: show possible similar pages on 404 page (#13840)
* docs: show possible similar pages on 404 page

* fix 404 page in api reference
2025-10-24 10:00:38 +03:00
Shahed Nasser
61565d243a chore: improve TSDocs for tax provider module (#13846) 2025-10-24 09:44:59 +03:00
Shahed Nasser
8d574d6f29 docs: improvements to tax related docs (#13845) 2025-10-24 09:44:47 +03:00
Leonardo Benini
226984cf0f feat(admin-*,dashboard): add dashboard i18n extensions (#13763)
* virtual i18n module

* changeset

* fallback ns

fallback to the default "translation" ns if the key isnt found. Allows to use a single "useTranslation("customNs")" hook for both custom and medusa-provided keys

* simplify merges

* optional for backward compat

* fix HMR

* fix generated deepMerge

* test
2025-10-23 15:16:43 -04:00
Shahed Nasser
012e30801e docs: add error page (#13839) 2025-10-23 18:10:42 +03:00
Shahed Nasser
4ab185c685 docs: clarify how emitEventStep emits an event in a workflow (#13836) 2025-10-23 16:30:25 +03:00
Shahed Nasser
90966633bb chore: update description of emitEventStep (#13838) 2025-10-23 16:03:00 +03:00
Anders Semb Hermansen
22d23b148e fix(js-sdk): add missing query param to deleteLineItem jsdoc (#13835) 2025-10-23 09:02:05 -04:00
Shahed Nasser
2ce0e37e98 docs-util: remove inferring of query parameters (#13834) 2025-10-23 14:15:59 +03:00
Adrien de Peretti
d51ae2768b chore(workflow-engine-*): cleanup and improvements (#13789)
**What**
Cleanup recent work on workflows
2025-10-23 10:50:24 +00:00
Shahed Nasser
356dcc94ce docs: avalara integration tutorial (#13808)
* docs: avalara integration tutorial

* fix getTaxLines method

* fixes

* fix broken link

* fix build error

* fix vale errors
2025-10-23 13:07:27 +03:00
Frane Polić
90162ebeac fix(medusa): images recreate on product update (#13813) 2025-10-23 09:32:34 +02:00
Shahed Nasser
5dd2e9aecf docs: add cache to comparison document + pricing fixes (#13812) 2025-10-22 18:43:50 +03:00
Shahed Nasser
55c42e112e docs: change binary encoding to base64 in file upload references (#13811) 2025-10-22 18:43:35 +03:00
Shahed Nasser
c7bb8d3beb docs: fix text in payload guide (#13815) 2025-10-22 18:43:14 +03:00
William Bouchard
fe4e7481a9 feat(order,dashboard): version order credit lines (#13766)
* feat(): version order credit lines

* undo last change

* adjust where

* remove date on ui

* Create five-donuts-obey.md

* add test

* nit comment

* woops
2025-10-22 10:26:05 +02:00
Sebastian Rindom
bad0858348 fix: prevent jobId collisions on workflow step retries (#13786)
## Summary

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

This PR fixes a bug where async workflow steps with retry intervals would get stuck after the first retry attempt due to Bull queue jobId collisions preventing retry jobs from executing.

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

Workflows using async steps with retry configurations (e.g., `retryInterval: 1`, `maxRetries: 5`) would fail once, schedule a retry, but the retry job would never execute, causing workflows to hang indefinitely.

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

**Root Cause:** Bull queue was rejecting retry jobs because they had identical jobIds to the async execution jobs that already completed. Both used the format: `retry:workflow:transaction:step_id:attempts`.

**Solution:** Modified `getJobId()` in `workflow-orchestrator-storage.ts` to append a `:retry` suffix when `interval > 0`, creating unique jobIds:
- Async execution (interval=0): `retry:...:step_id:1`
- Retry scheduling (interval>0): `retry:...:step_id:1:retry`

Updated methods: `getJobId()`, `scheduleRetry()`, `removeJob()`, and `clearRetry()` to pass and handle the interval parameter.

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

Added integration test `retry-interval.spec.ts` that verifies:
1. Step with `retryInterval: 1` and `maxRetries: 3` executes 3 times
2. Retry intervals are approximately 1 second between attempts
3. Workflow completes successfully after retries
4. Uses proper async workflow completion pattern with `subscribe()` and `onFinish` event

---

## Examples

```ts
// Example workflow step that would previously get stuck
export const testRetryStep = createStep(
  {
    name: "test-retry-step",
    async: true,
    retryInterval: 1, // 1 second retry interval
    maxRetries: 3,
  },
  async (input: any) => {
    // Simulate failure on first 2 attempts
    if (attempts < 3) {
      throw new Error("Temporary failure - will retry")
    }
    return { success: true }
  }
)

// Before fix: Step would fail once, schedule retry, but retry job never fired (jobId collision)
// After fix: Step properly retries up to 3 times with 1-second intervals
```

---

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

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2025-10-21 18:27:21 +00:00
Pepijn
5df903f5fb Added shipping method data to tax module context (#13747) 2025-10-21 13:36:29 -04:00
Nathan John
17fb3e2e10 feat(payment-stripe): merge custom metadata along with session_id on payment initiation (#13801)
* Merge custom metadata along with session_id on payment initiation

* update changeset
2025-10-21 13:35:13 -04:00
Shahed Nasser
a540256137 docs: change Medusa Cache setup information (#13802) 2025-10-21 17:31:56 +03:00
Adrien de Peretti
2d1d51a2af fix(test-utils): Duplicated subscribers re insertion (#13798)
* fix

* Create pink-boats-type.md
2025-10-21 16:00:48 +02:00
debashish
a34fcfab35 fix(): Remove redundant indexes to resolve schema warnings (#13736)
Fixes #13735

### What

This Pull Request introduces new database migrations to remove multiple redundant indexes across several core modules, including product, cart, order, customer, and inventory.

### Why

As detailed in issue #13735, a fresh Medusa installation produces numerous "Duplicate Index" warnings. These legacy indexes add unnecessary write overhead and provide no performance benefit. This PR cleans up the schema to resolve these warnings and improve database health.

### How

I have added one new, reversible migration file for each of the five affected modules:
- `@medusajs/product`
- `@medusajs/cart`
- `@medusajs/order`
- `@medusajs/customer`
- `@medusajs/inventory`

Each migration's `up()` method safely drops the older, redundant index, and its `down()` method re-creates it, ensuring the change is fully reversible and non-destructive.


### Testing

I have tested these migrations by following the local development workflow outlined in the `CONTRIBUTING.md` guide.

1.  **Setup:**
    *   Cloned my forked Medusa repository locally .
    *   Created a separate, fresh test project using `npx create-medusa-app@latest my-medusa-store`.
    *   The test project's PostgreSQL database, which already contained the schema with the duplicate indexes.

2.  **Linking Local Source Code:**
    *   In the test project's `package.json`, I modified all `@medusajs/*` dependencies and resolutions to point to the local packages in my forked repository (e.g., `"@medusajs/product": "file:../medusa/packages/modules/product"`).
    *   From the test project's directory, I ran `yarn install` to link the local, modified Medusa source code into its `node_modules`.

3.  **Build & Migration:**
    *   Inside my forked Medusa repository, I ran `yarn build` to compile the new TypeScript migration files.
    *   From the root of the **test project**, I then executed the migration command: `npx medusa migration run`.

4.  **Verification:**
    *   The command successfully identified and ran only the new migration files I had created.
    *   I also confirmed via direct SQL queries that the old, redundant indexes were correctly dropped from all affected tables (`product_collection`, `customer_group`, etc.).
2025-10-21 13:50:10 +00:00
Shahed Nasser
0d83918348 docs: fixes to type errors in guides (#13797) 2025-10-21 16:12:35 +03:00
Shahed Nasser
d9249be6e6 chore: fixes to refund reasons tsdocs (#13796) 2025-10-21 15:05:30 +03:00
Shahed Nasser
c6e58e5144 docs: fixes to API and JS SDK references (#13795) 2025-10-21 13:32:25 +03:00
github-actions[bot]
3d0f4086b4 chore(docs): Updated API Reference (automated) (#13794)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2025-10-21 09:14:39 +00:00
github-actions[bot]
1d63ed8ce9 chore(docs): Generated + Updated UI Reference (automated) (#13792)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-10-21 11:56:58 +03:00
github-actions[bot]
5bc9de9d2e chore(docs): Generated DML JSON files (automated) (#13790)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-10-21 11:56:47 +03:00
github-actions[bot]
858b3e3b9b chore(docs): Generated References (automated) (#13793)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-10-21 11:56:37 +03:00
github-actions[bot]
0da4790081 chore(docs): Update version in documentation (automated) (#13791)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-10-21 11:09:09 +03:00
Shahed Nasser
33f788be42 docs: fix name of caching redis module (#13788) 2025-10-21 10:41:32 +03:00
Shahed Nasser
76f9da5ef4 docs: Caching Module (#13701)
* standard docs for caching module + deprecated cache module

* added guides for creating + using, and overall changes from cache to caching

* fix details related to redis provider

* fix build errors

* fix build error

* fixes

* add guides to sidebar

* add sidebar util

* document query + index

* moved cache tag conventions

* fix build errors

* added migration guide

* added memcached guide

* fixes

* general fixes and updates

* updated reference

* document medusa cache

* small fix

* fixes

* remove cloud cache

* revert edit dates changes

* revert edit dates

* small update
2025-10-21 10:34:27 +03:00
Shahed Nasser
eefda0edce docs: cache in cloud (#13719)
* docs: cache in cloud

* fix build

* information updates

* add opt out info

* fix vale error
2025-10-21 10:33:25 +03:00
Shahed Nasser
ed715813a5 docs: docs for next release (#13621)
* docs: docs for next release

* changes to opentelemetry dependencies

* document plugin env variables

* document admin changes

* fix vale error

* add version notes

* document campaign budget updates

* document campaign changes in user guide

* document chages in cluster mode cli

* documented once promotion allocation

* document multiple API keys support
2025-10-21 10:32:08 +03:00
olivermrbl
f38f0f9aca chore: Release 2025-10-21 09:29:56 +02:00
github-actions[bot]
e47f0d0271 chore: Version Packages (#13545)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-21 09:24:59 +02:00
Shahed Nasser
20bfdac06d docs: document migrations on Cloud (#13785) 2025-10-20 19:24:30 +03:00
Shahed Nasser
150aa50397 feat(tax,types): Add method to retrieve a Tax Module Provider's service (#13784)
## Summary

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

Add a method in the Tax Module's servie to retrieve a provider by its ID.

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

The Tax Module Provider could be used for use cases other than calculating tax lines. For example, Avalara supports importing products to manage product-specific taxes. However, it's not possible right now to listen to the `product.created` event and create the product in Avalara with its provider. Instead, you'll have to create a separate module that also connects to Avalara and resolve it in the subsriber.

This also matches the pattern in the Analytics Module, which allows retrieving the underlying provider.

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

Add a `getProvider` method to the Tax Module's service and its interface.

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

Added integration test for the method.

---

## 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
const avalaraProvider = taxModuleService.getProvider("tp_avalara_avalara")
```

---

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

---

## Additional Context

Add any additional context, related issues, or references that might help the reviewer understand this PR.
2025-10-20 16:18:48 +00:00
Adrien de Peretti
516f5a3896 fix: workflow async concurrency (#13769)
* executeAsync

* || 1

* wip

* stepId

* stepId

* wip

* wip

* continue versioning management changes

* fix and improve concurrency

* update in memory engine

* remove duplicated test

* fix script

* Create weak-drinks-confess.md

* fixes

* fix

* fix

* continuation

* centralize merge checkepoint

* centralize merge checkpoint

* fix locking

* rm only

* Continue improvements and fixes

* fixes

* fixes

* hasAwaiting will be recomputed

* fix orchestrator engine

* bump version on async parallel steps only

* mark as delivered fix

* changeset

* check partitions

* avoid saving when having parent step

* cart test

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-10-20 15:29:19 +02:00
Shahed Nasser
d97a60d3c1 docs: document build output + Cloud troubleshooting (#13774) 2025-10-20 15:45:11 +03:00
Mayuresh-1306
1b6e53f032 docs: Set cache to no-cache in digital product examples (#13778)
Fixes medusajs/medusa#13687
2025-10-20 06:08:30 +00:00
Frane Polić
2d45ba7be1 fix(draft-order): email reset when changing customer (#13771) 2025-10-19 10:40:20 +02:00
Shahed Nasser
441e5e4710 docs: add deep thinking to AI assistant (#13770)
* docs: add deep thinking to AI assistant

* add disabled styling
2025-10-17 12:07:10 +03:00
Shahed Nasser
415d13091d docs: fix content shift in references (#13765) 2025-10-17 08:12:15 +03:00
Shahed Nasser
ee2734c23d docs: add troubleshooting for middlewares (#13764) 2025-10-16 14:43:21 +03:00
Shahed Nasser
e36c054780 docs: improve references loading (#13761)
* docs: improve references loading

* remove comment

* try remove generate metadata

* improvements and fixes
2025-10-16 14:25:01 +03:00
Shahed Nasser
4eb9628514 docs: add troubleshooting for subscribers + scheduled jobs not working (#13762) 2025-10-16 13:07:37 +03:00
Stevche Radevski
ee1c77a01f feat: Add support for multiple active keys at a time (#13754) 2025-10-16 10:07:08 +02:00
Shahed Nasser
1ca329d9b3 docs: clarify relation name for read-only links (#13758)
* docs: clarify relation name for read-only links

* small fix

* fix vale error
2025-10-16 10:27:14 +03:00