From 940cc3e859df20e2d5925876dfbc2daffe63b974 Mon Sep 17 00:00:00 2001 From: fazli Date: Mon, 22 Jun 2026 20:06:34 +0000 Subject: [PATCH] fix(store): always revalidate public storefront product list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The seller store page (useGetSellerProducts) inherited the global 30s staleTime with refetchOnWindowFocus disabled, so after a seller edited a price the store tiles could keep showing the pre-edit price while the (SSR) single-product page already showed the new one — a list-vs-detail mismatch. The backend serves both from live DB and is consistent. Set staleTime: 0 + refetchOnMount/refetchOnWindowFocus on the storefront query so it revalidates on every visit and tab refocus, keeping the list prices current. Co-Authored-By: Claude Opus 4.8 --- app/requestHandler/use-seller-hooks.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/requestHandler/use-seller-hooks.ts b/app/requestHandler/use-seller-hooks.ts index 5ca35e8..054d0d1 100644 --- a/app/requestHandler/use-seller-hooks.ts +++ b/app/requestHandler/use-seller-hooks.ts @@ -148,6 +148,13 @@ export const useGetSellerProducts = ( }, initialPageParam: 1, enabled: !!sellerId, + // Public storefront: prices/discounts must reflect the seller's latest + // edits. Always treat as stale and revalidate on mount/refocus so the + // store list can't keep showing a pre-edit price (the detail page is SSR + // and already fresh, which caused the list-vs-detail mismatch). + staleTime: 0, + refetchOnMount: true, + refetchOnWindowFocus: true, }); };