**What**
- Adjust lock duration, it is in seconds and not in ms
- Log on lock release
- Renew lock separately from the other promises
- Add more logs
- Log when lock can't be acquired. It can be expected in case two processes try to sync the same entity and in that case it can be ignored. But at least it gives some information in case it happens for another reason
- Log when the release lock failed, the lock will remain in the locking provider for 1 minute before being removed. But it wont prevent other entities to be synced
Solving issue [#12559](https://github.com/medusajs/medusa/issues/12559) this PR corrects the example file name provided in the Events and Subscribers section of the documentation. Previously, the guide instructed users to create a file at:
_`src/subscribers/order-placed.ts`_
However, the appropriate file name should be:
_`src/subscribers/product-created.ts`_
This fix aligns the documentation with the actual subscriber example, ensuring clarity and preventing confusion for developers following the guide.
<img width="1497" alt="subscriber-wrong-file-name" src="https://github.com/user-attachments/assets/23320e3d-75ee-4df9-9a9c-5b77edfe08ff" />
Changes
Updated the incorrect file name in the Subscriber section example from order-placed.ts to product_created.ts.
Review
@shahednasser – kindly review when you get the chance. Thanks!
`npm run install` in the first place is not a valid command, `yarn run install` will also be fixed by this change as we are using **npm-to-yarn** package for its conversion (tested).
`yarn run start` is a valid command, i know `yarn start` is a **short-hand** but i cant help here as we have't hardcoded it in the docs its being converted through the same package mentioned above, anyways both are valid so should be fine ig.
The `auth.login` method of the JS SDK allows passing custom, which is useful for custom authentication providers. For example:
```ts
const response = await sdk.auth.login("customer", "phone-auth", {
phone
})
```
However, the `auth.register` method doesn't allow that, so we can't do the following:
```ts
const response = await sdk.auth.register("customer", "phone-auth", {
phone
})
```
Instead, we'd have to use the `client.fetch` method.
This PR fixes the input type of the payload passed to the `register` method to be similar to that of `login`, which would allow using it with custom authentication providers
Since the runtime of the `@medusajs/analytics-posthog` relies on `posthog-node` package. It should be either installed as a dependency or a peerDependency that will be satisfied by the user project.
In this PR, I have added it as a peer dependency
Fixes: FRMW-2968
In this PR we have done two major things.
- First, we remove storing CSV contents within the workflow storage and neither store the JSON payloads to be created/updated in workflows. Earlier, they all were workflow inputs, hence were stored in the workflow
- Introduce a naive concept of chunks and process chunks one by one. The next PR making chunking a bit more robust while using streams, adding ability to resume from the failed chunk and so on.
> [!IMPORTANT]
> The new endpoint `/admin/product/imports` is not in use yet. But it will be after the next (final) PR.
## Old context in workflow storage

## New context in workflow storage

* feat: Add an analytics module and local and posthog providers
* fix: Add tests and wire up in missing places
* fix: Address feedback and add missing module typing
* fix: Address feedback and add missing module typing
---------
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
**What**
- Add missing index for query that falls in select in strategy, specifically the heaviest one with variant IN filtering
- Allow to force the strategy to be sent to the entry point module when using the graph API. It is useful with big dataset where filtering is enough without pagination and select in can offer better performances
e.g
```ts
await query.graph({
entity: 'product',
fields,
filters,
strategy: 'select-in' // <-- this will force the module to use receive this value and apply it accordingly
})
```