Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(medusa): Remove default job age option from EventBus #3388

Merged
merged 2 commits into from
Mar 6, 2023

Conversation

olivermrbl
Copy link
Contributor

@olivermrbl olivermrbl commented Mar 6, 2023

What
Revert EventBusService to not have default job age option

Why
Bull does not forward nested objects in job configurations correctly to Redis.

Options that are part of a nested object are ignored completely:

emit("some-event", data, { removeOnComplete: { age: 10 } })

You can only pass top-level options, meaning the following works:

emit("some-event", data, { removeOnComplete: 10 })

When nested object options are passed to Redis, they have the following shape:

{ removeOnComplete: [object Object] }

So they won't be picked up.

To add to that, stringifying the options in the emit call (which is something I would expect Bull would do for us under the hood), does not work in bull, only in bullmq.

Stringifying turned out not to be the issue. Nested options do not work at all in bull. I am yet to find out why. Have reached out to the maintainer.

@olivermrbl olivermrbl requested a review from a team as a code owner March 6, 2023 12:45
@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2023

🦋 Changeset detected

Latest commit: 522f048

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@medusajs/medusa Patch
@medusajs/inventory Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Mar 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
medusa-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 6, 2023 at 1:48PM (UTC)

@olivermrbl
Copy link
Contributor Author

/snapshot-this

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]

Latest commit: ba5d34e

@olivermrbl olivermrbl marked this pull request as ready for review March 6, 2023 16:58
@olivermrbl olivermrbl merged commit aa0d1f3 into master Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants