-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
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
developbranch and create Pull Request2. Feature / Improvementback todevelop. - This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from
releasebranch and create Pull Request3. Stabilisation fixback torelease. - 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
hotfixormasterbranch and create Pull Request4. Hotfixback tohotfix.
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 :)