Skip to content

Feat/zipcode soft refresh query allowlist#760

Merged
hiagolcm merged 6 commits into
masterfrom
feat/zipcode-soft-refresh-query-allowlist
Jun 24, 2026
Merged

Feat/zipcode soft refresh query allowlist#760
hiagolcm merged 6 commits into
masterfrom
feat/zipcode-soft-refresh-query-allowlist

Conversation

@hiagolcm

Copy link
Copy Markdown
Contributor

What problem is this solving?

How to test it?

[Workspace](Link goes here!)

Screenshots or example usage:

Describe alternatives you've considered, if any.

Related to / Depends on

How does this PR make you feel? 🔗

![](put .gif link here - can be found under "advanced" on giphy)

hiagolcm and others added 4 commits June 11, 2026 09:15
…clear

Co-authored-by: Cursor <cursoragent@cursor.com>
…clear

When vtex.delivery-promise-components clears the `page` query param
through render-runtime after a location change, the useFetchMore reducer
was left on the stale page. A shopper on page 5 would see page-1 results
but the next "load more" fetched page 6. Detect the external transition
(`runtimeQuery.page` going absent/1 while the reducer is past page 1) and
dispatch RESET so the next "load more" correctly fetches page 2. Shopper-
driven "load more"/"fetch previous" and initial mount are unaffected.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
With enableLazySearchQuery on and maxItemsPerPage > 18, SearchQuery
fetches the first 18 items and lazily loads items 18..N-1 once. An
external refetch (vtex.delivery-promise-components location change) resets
the Apollo cache to the initial 18-item window, but lazyItemsRemaining was
already consumed at mount — items 18..N-1 would never be fetched again,
leaving a permanent gap before the next "load more" page.

The new useLazyItemsRearm hook detects the cached list shrinking back to
(or below) the initial window while on the first page and resets
lazyItemsRemaining, re-triggering the existing 500ms lazy-refill effect.
Guards prevent false positives on initial mount, list growth, empty lists,
and pages past the first.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hiagolcm hiagolcm requested review from a team as code owners June 11, 2026 12:21
@hiagolcm hiagolcm requested review from RodrigoTadeuF, gabpaladino and leo-prange-vtex and removed request for a team June 11, 2026 12:21
@vtex-io-ci-cd

vtex-io-ci-cd Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot

Copy link
Copy Markdown

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

@chrsmutti chrsmutti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with the lazyItems stuff, but it looks right! Just have a nitpick on the Changelog.

Comment thread react/__tests__/useFetchMore.test.js
Comment thread CHANGELOG.md Outdated
hiagolcm added 2 commits June 24, 2026 12:25
…efresh-query-allowlist

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	CHANGELOG.md
@hiagolcm hiagolcm merged commit 0bc9f77 into master Jun 24, 2026
7 checks passed
@hiagolcm hiagolcm deleted the feat/zipcode-soft-refresh-query-allowlist branch June 24, 2026 15:38
@vtex-io-ci-cd

vtex-io-ci-cd Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Your PR has been merged! App is being published. 🚀
Version 3.147.4 → 3.147.5

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.search-result@3.147.5

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. 📖

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.

2 participants