Skip to content

fix(commerce-server): respect product listing channels in storefronts - #1532

Merged
sbolinger-godaddy merged 2 commits into
mainfrom
respect-product-listing-channels-in-storefronts
Nov 6, 2026
Merged

sbolinger-godaddy merged 2 commits into
mainfrom
respect-product-listing-channels-in-storefronts

Conversation

@gbashimam-godaddy

Copy link
Copy Markdown
Collaborator

Summary

Storefront product queries filtered by active status but ignored the configured Commerce channel. Products unavailable on the storefront’s channel could appear in lists and remain accessible through direct product links.

Apply the server-configured channel filter to product lists and product-detail eligibility checks. Products unavailable on that channel now return 404 from the detail route.

  • Preserve channel filtering during search, category filtering, pagination, and explicit product-ID requests.
  • Prevent browser query parameters from overriding the configured channel.
  • Preserve visibility for products available on all channels.
  • Update documentation and add a patch changeset.

AAB already provisions GODADDY_CHANNEL_ID; no new browser parameter or AAB configuration change is required.

Validation

  • Regression tests reproduced cross-channel listing and direct-link failures before the fix and pass afterward.
  • All 257 server package tests pass.
  • Typecheck, Biome lint, build, and changeset validation pass.
  • Integration tests use a mocked Commerce upstream; no live storefront validation was performed.

@gbashimam-godaddy gbashimam-godaddy self-assigned this Nov 5, 2026
@gbashimam-godaddy
gbashimam-godaddy requested a review from a team as a code owner November 5, 2026 20:06
@changeset-bot

changeset-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 959bd32

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

This PR includes changesets to release 1 package
Name Type
@godaddy/gd-commerce-server 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

@sbolinger-godaddy sbolinger-godaddy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! Nothing major found, approving. A few small things you may want to look at, none of them blockers:

  • Stale channel = empty store. If GODADDY_CHANNEL_ID points at an inactive or unregistered channel, catalog-api-v2 treats it as in: []. Every list then comes back empty and every PDP returns 404, with no error. A warning log when an unfiltered list returns zero products, or a README note, would make that easier to debug.
  • Extra upstream call. Any channelId filter makes the catalog API page through /v1/commerce/channels on each request (it has a TODO to cache this). Fine for now, just worth knowing.
  • SKU route isn't channel-filtered. skus/[id] and cart-add by skuId still resolve off-channel SKUs. Low impact, but a short README note would help, since it currently says direct links return 404.

What I checked:

  • Confirmed in catalog-api-v2 that channelId: { eq } is supported and that products without channel assignments still match, so the "all channels" test matches real API behavior.
  • Checked out the branch: typecheck is clean and all 257 server tests pass.
  • Didn't test against a live store.

@sbolinger-godaddy
sbolinger-godaddy merged commit 4cd44e2 into main Nov 6, 2026
3 checks passed
@sbolinger-godaddy
sbolinger-godaddy deleted the respect-product-listing-channels-in-storefronts branch November 6, 2026 16:26
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