Skip to content

Infinite scrolling category view and category-next/loadMoreCategoryProducts isn't working anymore #3879

@cewald

Description

@cewald

Current behavior

Since the fix for the category page memory-leak #3787 the infinite scrolling isn't working anymore.

Actually it's about the CATEGORY_ADD_PRODUCTS mutation which is called in the category-next/loadMoreCategoryProducts action. It lacks the changes of #3787 fix so it only adds its results to the state but not to the nonReactiveState which again leads to the problem that the catalog-next/getCategoryProducts getter will return null values for this products and drops the following error in the frontend:

[Vue warn]: Error in render: "TypeError: Cannot read property 'id' of undefined"

found in

---> <ProductListing> at src/themes/default/components/core/ProductListing.vue
       <LazyHydrate>
         <Category> at src/themes/default/pages/Category.vue
           <DefaultLayout> at src/themes/default/layouts/Default.vue
             <App> at src/themes/default/App.vue
               <Root>

Expected behavior

The new items should be added to the state and nonReactiveState inside of the mutation.

Steps to reproduce the issue

  • Go to src/themes/default/pages/Category.vue and change THEME_PAGE_SIZE to e.g. 12
  • Run VSF and go to http://localhost:3000/women/tops-women/tops-21
  • You should only see 12 products
  • You then go down the infinite scrolling wouldn't work because of an error

Repository

Latest release/v1.11 5c73791
But caused by #3787 and 2c6e0e1

Can you handle fixing this bug by yourself?

  • YES
  • NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Environment details

  • Browser: Chrome
  • OS: OSX
  • Node: 10 LTS
  • Code Version: Latest release/v1.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2: ImportantPriority mark - still high ;)bugBug reports

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions