From 70ee48fff4b1f345601dd27e173902e21b473077 Mon Sep 17 00:00:00 2001 From: marcoferreiradev Date: Wed, 2 Sep 2026 15:09:31 -0300 Subject: [PATCH] fix(vtex): stop echoing a page the key already resolved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `pageOf` put the resolved page in the key, and the loop below went on appending the raw `?page` on top of it. The two no longer agree — resolved 0 against a raw 1 — so the dedup that used to collapse them cannot, and one page becomes two entries: the storefront renders page 1 with no `?page` at all while its own client-side pagination asks for that same page as `?page=1`. Measured: the render warms it (miss 1738ms) and the client-side call now reads it (hit 8ms); page 2 still mints its own (miss 1997ms) and both keep hitting. Before, each side had its own entry for identical products. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01YFJdpNZtWBobnhj3CPPuMj --- vtex/loaders/intelligentSearch/productListingPage.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vtex/loaders/intelligentSearch/productListingPage.ts b/vtex/loaders/intelligentSearch/productListingPage.ts index 43fced662..db8d31640 100644 --- a/vtex/loaders/intelligentSearch/productListingPage.ts +++ b/vtex/loaders/intelligentSearch/productListingPage.ts @@ -83,10 +83,17 @@ export const mapLabelledFuzzyToFuzzy = ( return; } }; +/** + * URL params that still say something the props block above did not already say. + * + * `page` is deliberately absent: `pageOf` already resolved it into the key, and + * echoing the raw value on top splits one page in two — the storefront renders + * page 1 with no `?page` while its own client-side pagination asks for the same + * page as `?page=1`. + */ const ALLOWED_PARAMS = new Set([ "ps", "sort", - "page", "o", "q", "fuzzy",