Skip to content

Conversation

@MatheusLealv
Copy link
Contributor

This Fix is related to this report:

Fixes "Load More" button not loading additional organic products when ads are present.

Problem

When ads are merged into search results, the product array includes both ads and organic products. This count was being passed to useFetchMore, causing Apollo to calculate incorrect pagination offsets.

Example: 3 ads + 20 organic = 23 products

  • Apollo thinks it has 23 products
  • Tries to fetch from position 23
  • But server only has 20 organic products
  • No additional products load

Solution

Filter out ads before passing the product list to useFetchMore, ensuring pagination uses only organic product count.

Changes

  • react/FetchMore.js: Filter advertisement products before passing to useFetchMore

How to test it?

Follow this video to try to reproduce the issue: https://drive.google.com/file/d/1fdDjY9wLAlVXEfM3x9YwOVdMIsgxmPGC/view

workspace with the fix applied by vtex link: https://leal--supernossoio.myvtex.com/mercearia

How does this PR make you feel? 🔗

@vtex-io-ci-cd
Copy link
Contributor

vtex-io-ci-cd bot commented Jan 9, 2026

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

vtex-io-docs-bot bot commented Jan 9, 2026

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 🎉🎉

Copy link

@amandascm amandascm left a comment

Choose a reason for hiding this comment

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

LGTM

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.

5 participants