Repository navigation
fix: PLP "Load more products" overwriting list instead of appending - #3308
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
## What's the purpose of this pull request? Bring `dev` into `main` so the next CD run on `main` cuts and publishes `@faststore/*@4.1.0`. Includes the publish-pipeline fix from #3309, so this is also the first release that exercises the `pnpm -r publish` flow end-to-end (broken `4.0.0` is superseded by `4.1.0` as `latest`). ## What's included since v4.0.0 - #3308 — fix: PLP "Load more products" overwriting list instead of appending - #3306 — feat: user details adjusts — SFS-2950 - #3304 — fix: updates schemas vtex.faststore - #3301 — fix: localization selector stale and reset selection for unsaved changes - `d1e40abe7` — fix: add repository field to diagnostics package for OIDC provenance - #3309 — fix: publish releases with pnpm to resolve workspace and catalog protocols (already on `main`, kept by 3-way merge) ## How CD will behave on merge 1. `lerna version --conventional-commits --conventional-graduate --yes` graduates `4.1.0-dev.1` → `4.1.0`, creates tag `v4.1.0`, and pushes the `[no ci] Release: 4.1.0` commit. 2. `pnpm release:verify` packs every public package and asserts no `workspace:` / `catalog:` literal survives the pack step. 3. `pnpm -r publish --access public --no-git-checks` uploads the 8 public packages with all `workspace:*` / `catalog:` references rewritten to concrete versions. ## Sanity checks already performed locally - `git merge-tree` between `origin/main` and `origin/dev`: clean, no conflicts. - `pnpm install --frozen-lockfile` on the merged tree: no lockfile drift. - `pnpm release:verify` on `release/4.1.0`: all 8 public packages clean at `4.1.0-dev.1` (the same manifests that will be bumped to `4.1.0`). ## Follow-ups (not blocking) - Once `4.1.0` is on `latest`, consider `npm deprecate @faststore/<pkg>@4.0.0 "Broken release: workspace:/catalog: not resolved. Use 4.1.0+"` for `cli`, `core`, `api`, `ui`, `components`, `sdk`, `diagnostics`, `lighthouse`. - Optional: add `workflow_dispatch` to `release.yml` so future hotfix releases without `packages/*` changes can be triggered manually with `--force-publish`. Made with [Cursor](https://cursor.com) --------- Co-authored-by: Larícia Mota <[email protected]> Co-authored-by: Matheus P. Silva <[email protected]> Co-authored-by: Leandro Rodrigues <[email protected]> Co-authored-by: vtexgithubbot <[email protected]> Co-authored-by: Lucas Feijó <[email protected]> Co-authored-by: Luiz Falcão <[email protected]> Co-authored-by: Artur Santiago <[email protected]> Co-authored-by: Sahan Jayawardana <[email protected]> Co-authored-by: Mateus Pontes <[email protected]> Co-authored-by: Matheus Martins <[email protected]> Co-authored-by: renatomaurovtex <[email protected]> Co-authored-by: Leandro Rodrigues <[email protected]> Co-authored-by: Fanny Chien <[email protected]> Co-authored-by: Arthur Andrade <[email protected]> Co-authored-by: Cursor <[email protected]> Co-authored-by: Thiago Pereira <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Giuliana Rigaud <[email protected]> Co-authored-by: renato <[email protected]> Co-authored-by: Bruna Santos <[email protected]> Co-authored-by: BrunaCubos <[email protected]> Co-authored-by: Ícaro Oliveira <[email protected]> Co-authored-by: Bruna Santos <[email protected]> Co-authored-by: Everton Ataide <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Otavio Moreira Meirelles <[email protected]> Co-authored-by: Marco Cardoso <[email protected]> Co-authored-by: Gabriel Paladino <[email protected]> Co-authored-by: CodeRabbit <[email protected]>
What's the purpose of this pull request?
On a PLP, clicking "Load more products" was supposed to append the next 12 products below the existing 12. Instead, the new page replaced the current list, so the user kept seeing only 12 items.
Root cause: the
Providerin@faststore/sdkwas resetting the infinite-scrollpagesarray on every URL change reaching<SearchProvider>. Two converging conditions made it fire on a Sentinel-triggered URL update:parseSearchStatealways returns a newselectedFacetsarray reference, even when the content is identical.Sentinelreflects the page in viewport into the URL viarouter.replace('?page=N'). That update bubbles back to theProviderviaasPath, and the effect's referential deps fire, callingresetInfiniteScroll(N), which collapsespagesto[N].How it works?
The
useEffectinpackages/sdk/src/search/Provider.tsxwas split into two with different responsibilities:setState(rest)keeps running on any change toterm,sort,selectedFacets, orpage— preserving the search-context sync introduced in fix: search update #3015.resetInfiniteScrollnow runs only when the content of the search (term/sort/selectedFacets) changes, gated by a stable, content-based key built viaJSON.stringify. Page-only URL updates no longer trigger a reset.rest.pageis intentionally excluded from the reset effect's deps. React closures still capture the latest value at the moment the effect runs, so when content actually changes (e.g., the user toggles a filter, which atomically also setspage: 0), the reset uses the correct page. Aneslint-disablewith a code comment documents the intent.How to test it?
Pre-conditions: any PLP with more than 12 products and "Load more products" enabled.
/<plp>?page=2, the gallery should open directly on page 2 (deep-link still works).Starters Deploy Preview
URL Preview with fix
References
fix: search update) — introduced the dependency-array on theProvidereffect that, combined with theSentinel, caused the regression.Summary by CodeRabbit