Skip to content

Fix product 2 image by normalizing deprecated catalog URLs#327

Draft
aviramha wants to merge 1 commit into
mainfrom
cursor/fix-product-2-image-f256
Draft

Fix product 2 image by normalizing deprecated catalog URLs#327
aviramha wants to merge 1 commit into
mainfrom
cursor/fix-product-2-image-f256

Conversation

@aviramha

@aviramha aviramha commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Product 2 ("Team Work Makes The Dream Work T-Shirt") failed to show an image in the shop UI because the shared inventory database still stores a removed Cloudinary path (Metal Mart/samples/mirrord-hoodie-front) with a leading empty string in image_urls.

This PR repairs catalog responses at the inventory API layer and adds defensive filtering in the frontend image helpers.

Changes

  • inventory-service: Normalize product rows before returning them from GET /products and GET /products/:id
    • Map the deprecated Metal Mart/samples/mirrord-hoodie-front path to the current front/back Cloudinary public IDs
    • Trim and drop blank entries from image_urls
    • Fall back to image_url when image_urls is empty
  • metal-mart-frontend: Filter blank strings from image_urls in getImageUrls / getPrimaryImageUrl

Verification

Verified with mirrord (session: cursor-fix-product-2-image-f256) against the playground cluster:

  • Filtered GET /shop/api/products/2 returns usable image_urls[0] (team_Work_makes_the_Dream_Work_-_front_w5qdnb)
  • Unfiltered traffic continues to hit the cluster deployment (bad legacy data unchanged in DB)
  • Playwright: 9/9 checks passed — product 2 detail hero image loads, no "No image" placeholders on /shop/products or /shop/products/2

Screenshots

Products grid — all 16 products show images, including product 2:

Products grid with all images loading

Product 2 detail — front image and front/back thumbnails load correctly:

Product 2 detail page with hero image and thumbnails

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Product 2 in the shared inventory DB still references a removed
Cloudinary path (Metal Mart/samples/mirrord-hoodie-front). Map that
legacy value to the current front/back public IDs at the API layer and
filter blank image_urls entries in the frontend helpers.
@github-actions

Copy link
Copy Markdown
Contributor

mirrord Preview Environment - Metal Mart

Changed services: metal-mart-frontend, inventory-service

E2E gate: ✅ passed
Preview: 🚀 started

Service E2E gate Preview
inventory-service skipped started
metal-mart-frontend skipped started
Preview URL https://playground.metalbear.dev/shop
Header baggage: mirrord-session=fix-product-2-image-f256
Sessions all mirrord sessions (or run mirrord ui in terminal)

To send traffic to this preview:

  • Use the mirrord Browser Extension and set the header for this URL, or
  • curl -H "baggage: mirrord-session=fix-product-2-image-f256" https://playground.metalbear.dev/shop

Preview is stopped when the PR is merged or closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant