Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR silently fails on 'category/single' when root category exists in ES #3732

Closed
2 of 5 tasks
cporte opened this issue Oct 20, 2019 · 2 comments
Closed
2 of 5 tasks
Assignees
Labels
Milestone

Comments

@cporte
Copy link

cporte commented Oct 20, 2019

Current behavior

When ES contains the root category and going directly to a page awaiting 'category/single' dispatch in asyncData method (e.g. category or product page), the promise is never resolved and the asyncData method never ends.

Expected behavior

The promise should always be resolved or rejected. I believe a else { resolve(mainCategory) } is missing after the if(sc.parent_id) in catalog/store/category/actions.ts, method Single, in the recursive dispatch single

Steps to reproduce the issue

Add the a category in ES with the ID of the root category and a null or 0 parent_id. Then go directly to a category page without using the internal routing.

Repository

Can you handle fixing this bug by yourself?

  • YES
  • NO

(I can definitely do a PR with the one line change, but considering the complexity of this code I might have missed a more elegant way of fixing this. We might for example want to reject if having the root category in ES is problematic somewhere else)

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: Tested on Vivaldi and Chrome
  • OS: Linux
  • Node: 10.16.3
  • Code Version: 1.10.4 (slightly modified, but modifications are not related to this bug)

Additional information

I use a custom backend, explaining why the root category was present. I believe this bug will not happen with usual backends, but if it can save a couple hours of debugging to the next customist, why not :)

@cporte cporte added the bug Bug reports label Oct 20, 2019
@andrzejewsky andrzejewsky added this to the 1.11.0-rc2 milestone Oct 20, 2019
@andrzejewsky andrzejewsky self-assigned this Oct 20, 2019
@andrzejewsky
Copy link
Contributor

@cporte thanks for reporting! Should be easy to fix.

@cporte
Copy link
Author

cporte commented Oct 25, 2019

Thanks a lot for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants