Reconnecting Mercur's Algolia Sync to Inventory and Shipping Changes
Five subscribers that were wired up but never triggered, and the bridge that triggers them.
Short answer
Mercur's Algolia registry block listened for five "intermediate" events about inventory, stock locations, fulfillment sets, service zones and shipping options, but nothing in the codebase emitted them. After a product was first indexed, those changes never refreshed its Algolia record. The fix adds a subscriber that listens to the underlying module events and re-emits the matching intermediate events. It was merged as PR #1416 and closed issue #1244.
The problem
Mercur is an open-source multi-vendor marketplace platform built on Medusa. Issue #1244 laid out the regression in detail. Emitters added in an earlier PR "appear to have been lost when the monorepo was split into plugins/registry". The subscribers moved into the registry package; the emitters did not.
The fix
A new subscriber, algolia-intermediate-events-bridge.ts, maps module events to intermediate events:
const INTERMEDIATE_EVENT_BY_SOURCE: Record<string, IntermediateEvents> = {
...mapToIntermediateEvent(
`${Modules.INVENTORY}.inventory-item`,
IntermediateEvents.INVENTORY_ITEM_CHANGED
),
...mapToIntermediateEvent(
`${Modules.STOCK_LOCATION}.stock-location`,
IntermediateEvents.STOCK_LOCATION_CHANGED
),
...
}
Inventory-level events are resolved to their inventory item IDs before re-emitting. The new file is also registered in the block's registry manifests so it ships with the block.
By the numbers
- Repository: mercurjs/mercur, 1,880 stars (Nov 3, 2026), TypeScript, MIT
- Files changed: 4
- Lines: +148 / -1
- Commits: 3 (2 from the PR author, 1 maintainer merge of main)
- Opened: Aug 21, 2026. Merged: Aug 31, 2026. Time to merge: 9 days, 21 hours
- Review: merged by a maintainer after one review comment
How the review went
The maintainer spotted a gap within half an hour: "algolia/subscribers/algolia-intermediate-events-bridge.ts I dont see this new file in registry". The first commit had listed the file in the registry manifests without adding the source file itself. The follow-up commit added it, and the maintainer merged the PR. The original PR body also retained a tooling placeholder saying its structured explanation was incomplete; that text is not evidence of validation.
FAQ
Did the fix add tests?
No test file is included in the merged diff.
Where can I read more?
See the pull request and the original issue.
The goal
Refactors lose wiring. A bridge that restores it in one place, rather than re-adding emit calls in every route, keeps the event flow easy to see.
---
This fix was developed with Prilog. Read the original case study on the Prilog blog.
Mentions
Reconnecting Mercur's Algolia Sync to Inventory and Shipping Changes Five subscribers that were wired up but never triggered, and the bridge that triggers them. Short answer Mercur's Algolia registry block listened for five "intermediate" events about inventory, stock locations, fulfillment sets, service zones and shipping options, but nothing in the codebase emitted them. After a product was first indexed, those changes never refreshed its Algolia record. The fix adds a subscriber that listens to the underlying module events and re-emits the matching intermediate events. It was merged as PR #1416 and closed issue #1244. The problem Mercur is an open-source multi-vendor marketplace platform built on Medusa. Issue #1244 laid out the regression in detail. Emitters added in an earlier PR "appear to have been lost when the monorepo was split into plugins/registry". The subscribers moved into the registry package; the emitters did not. The fix A new subscriber, algolia-intermediate-events-bridge.ts, maps module events to intermediate events: const INTERMEDIATE_EVENT_BY_SOURCE: Record<string, IntermediateEvents> = { ...mapToIntermediateEvent( `${Modules.INVENTORY}.inventory-item`, IntermediateEvents.INVENTORY_ITEM_CHANGED ), ...mapToIntermediateEvent( `${Modules.STOCK_LOCATION}.stock-location`, IntermediateEvents.STOCK_LOCATION_CHANGED ), ... } Inventory-level events are resolved to their inventory item IDs before re-emitting. The new file is also registered in the block's registry manifests so it ships with the block. By the numbers - Repository: mercurjs/mercur, 1,880 stars (Nov 3, 2026), TypeScript, MIT - Files changed: 4 - Lines: +148 / -1 - Commits: 3 (2 from the PR author, 1 maintainer merge of main) - Opened: Aug 21, 2026. Merged: Aug 31, 2026. Time to merge: 9 days, 21 hours - Review: merged by a maintainer after one review comment How the review went The maintainer spotted a gap within half an hour: "algolia/subscribers/algolia-intermediate-events-bridge.ts I dont see this new file in registry". The first commit had listed the file in the registry manifests without adding the source file itself. The follow-up commit added it, and the maintainer merged the PR. The original PR body also retained a tooling placeholder saying its structured explanation was incomplete; that text is not evidence of validation. FAQ Did the fix add tests? No test file is included in the merged diff. Where can I read more? See the pull request and the original issue. The goal Refactors lose wiring. A bridge that restores it in one place, rather than re-adding emit calls in every route, keeps the event flow easy to see. --- This fix was developed with Prilog. Read the original case study on the Prilog blog.
Mercur – add third-party sellers to an existing Magento store
Open-source Magento 2 Connector for adding third-party sellers to your store I built a Magento 2 module that lets other sellers list on your store. Magento stays as it is, no replatforming, MIT license. Installs with composer, works on Magento 2 and Adobe Commerce. Magento stays your commerce engine and the system of record. Sellers and their offers are mirrored in, shown on the product page and in the cart, and the order goes to the marketplace side only after it has been placed in Magento. The marketplace part is covered by Mercur - an open-source marketplace platform on Medusa.js. GitHub: mercurjs/magento2-connector Docs: docs.mercurjs.com This is a fresh first release, and some things aren't covered yet. Leave feedback if you have any requests!