asyncPropsExtenders are applied multiple times. This causes a growing amount of requests.
See original GitHub issueDescribe the bug Website fails to render properly. Plone backend logs a growing list of requests of actions registered with asyncPropsExtenders in add-on volto-dropdownmenu
To Reproduce
- set up Volto with add-on volto-dropdownmenu
- log Volto asyncConnect replacement
const applyExtenders = (asyncItems, pathname) => {
console.log('applyExtenders', asyncItems);
Software (please complete the following information):
- Volto 12.4.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
yes is in volto-dropdownmenu. We tried to remove it, because it also works without async loading, and we found that there’s the problem for all the asyncConnect calls. We have seen a lot of request on plone for all asyncConnect in App.jsx. So, the problem i think is not only with asyncPropsExtenders, but with all asyncConnect, or maybe ssr is done multiple time for one page…
For the “record”, here’s @giuliaghisini + @nzambello’s solution:
From the solution, it looks like this: the extend() function can be called multiple times (I’ll have to see if that’s normal or not), so you have to protect against pushing multiple times your dispatch.
Sorry about this… it’s been a while since I’ve been looking at that code, so I’ll have to familiarize myself again with it. In any case, there’s still the odd behavior of the double SSR call. Worth investigating.