Repository navigation
Feature: Guard against published products being silently invisible on the storefront (opt-in default-channel auto-link / dashboard validation) #17807
dishanagalawatta
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Originally opened as issue #17801 — closed by the triage bot with a pointer here.
Context
A published product with no sales-channel links is silently invisible on the storefront:
GET /store/productsis scoped by the publishable API key to its linked sales channels and only returns products that are bothstatus = publishedand linked to one of those channels. The admin dashboard lets an operator flip draft → published without assigning a channel, and the result is a 200 with an empty list — no error, no signal, anywhere.This was reported as #14374 ("Successfully created product is not shown in the storefront") and closed as a docs issue. We hit it in production anyway (new operator publishes a product; storefront shows nothing; everyone assumes a caching bug) — the docs describe the rule, but nothing guards against the trap.
Reproduction
status = published(dashboard toggle or API) without touching sales channels.GET /store/products?publishable_key=<key>→200 { count: 0 }.Why this matters
Proposed solution (respecting the multi-channel doctrine)
Any of these, ordered by impact:
Option A — opt-in auto-link setting. A store-level setting (e.g.
auto_link_published_products_to_default_channel, default off) consulted by the product create/update core-flows: when a product transitions topublishedwith zero channel links, link it to the store'sdefault_sales_channel_id. Opt-in, so multi-channel merchants are unaffected.Option B — dashboard validation. In the admin product form, when an operator sets the product to published while no sales channel is selected, show a warning (or configurable block): "This product will not appear on any storefront until it is assigned to a sales channel."
Option C — detectability minimum. Expose a cheap signal for storefronts/integrations to detect the condition (e.g. include
sales_channelsin standard product admin responses when requested, and document the check).Reference implementation (running in production on Medusa 2.22.6)
We implemented Option A as a fire-and-forget subscriber, precisely to keep it opt-in and non-invasive:
Happy to open a PR for Option A behind a flag, or contribute the dashboard warning if the maintainers prefer Option B.
All reactions