Skip to content

fix: restore full catalog (stop flash-only wipe) - #68

Merged
SteveSimonson merged 1 commit into
mainfrom
fix/restore-static-catalog-merge
Aug 2, 2026
Merged

fix: restore full catalog (stop flash-only wipe)#68
SteveSimonson merged 1 commit into
mainfrom
fix/restore-static-catalog-merge

Conversation

@SteveSimonson

Copy link
Copy Markdown
Owner

Fixes #67

Summary

PR #64 made a healthy flash response the only shop pool. Flash currently publishes ~12 SKUs, so most of the house/BSR assortment disappeared.

This restores flash layered on top of static (dedupe by ASIN). Full collection comes back; live flash still surfaces first.

Risk

Low — reverts assortment policy to pre-wipe merge behavior.

Test plan

  • unit tests + lint
  • Live /shop product count back to full range after deploy
  • Flash items still present when API healthy

Flash-only SoT wiped the shop to ~12 SKUs. Layer live flash on top of
the static house/BSR assortment again until Flash publish depth can
safely own the full shelf.
@SteveSimonson

Copy link
Copy Markdown
Owner Author

Independent review — fix/restore-static-catalog-merge

Scope: Hotfix for flash-only wipe (#67 / PR #64). Verified merge policy, UI source labels, and contract test.

Verification: merge is flash-over-static (not flash-only)

Confirmed correct. In useFlashCatalog:

function mergeFlashOverStatic(flash: Product[]): Product[] {
  return finalizePool([...flash, ...shopProducts])
}
// ...
if (flashOnly.length > 0) {
  return {
    products: mergeFlashOverStatic(flashOnly),
    flashOnly,
    source: 'merged' as const,
    // ...
  }
}
  • Flash products are prepended to shopProducts, then finalizePool dedupes by ASIN (first wins) and slug.
  • Result: flash layers on top; full static house/BSR assortment remains.
  • Empty/unreachable flash still falls back to finalizePool(shopProducts) with source: 'static'.
  • Shop/Home/Product/Quiz/Vibe all consume flash.products, so they all get the restored full pool.

This is the right fix for a ~12-SKU flash control plane wiping the house catalog.

What else looks good

  • Shop badge copy updated for merged vs static; shows live flash count without implying emergency-only catalog.
  • Contract test updated to assert flash-first ASIN dedupe keeps non-overlapping static SKUs (tests/flash-catalog.test.mjs — passes locally).
  • catalog.ts header comment aligned with merge policy.
  • Small, focused diff (4 files); low risk revert of assortment policy.

Nits (non-blocking)

  1. Dead union member: source: 'flash' | 'static' | 'merged' never returns 'flash' anymore. Drop 'flash' from the type (or keep only if a future path reintroduces flash-only intentionally).
  2. No-op error expression:
    error: error || (loading ? undefined : undefined)error. Simplify for readability.
  3. Stale SoT comments outside this diff: src/lib/flashCatalog.ts still says flash is assortment SoT / static is emergency-only. Worth a follow-up so docs match the restored merge policy (catalog.ts filter helper comments still mention “flash SoT” / “static emergency” too).
  4. Contract test is a reimplementation, not an import of mergeFlashOverStatic / finalizePool (file already notes Vite/TS import limits). Fine for Phase A, but a future pure export would lock the real function.

Residual risk / test plan

  • Unit contract + local test pass; CI lint/build was still pending at review time.
  • Post-deploy: confirm /shop product count is full range again and flash SKUs still appear first when the API is healthy.

VERDICT: APPROVE_WITH_NITS

@SteveSimonson
SteveSimonson merged commit f0da5ac into main Aug 2, 2026
1 check passed
@SteveSimonson
SteveSimonson deleted the fix/restore-static-catalog-merge branch August 2, 2026 23:09
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.

Hotfix: flash-only mode wiped most iBamboo products

1 participant