adobe / aem-boilerplate

Use this repository template for new AEM projects.
https://main--aem-boilerplate--adobe.aem.page
Apache License 2.0
118 stars 304 forks source link

multiple calls to decorateIcons leaves icons empty #217

Open andresbott opened 1 year ago

andresbott commented 1 year ago

When programatically calling decorateIcons() more than once during the initial rendering ( e.g. from a block js that is present more than once in a page) only the icon related to the first call will be printed, the rest of the icons will be replaced with: https://github.com/adobe/helix-project-boilerplate/blob/main/scripts/lib-franklin.js#L189

The current hypothesis it concurrent access to ICONS_CACHE, the first call sets the value to true in: https://github.com/adobe/helix-project-boilerplate/blob/main/scripts/lib-franklin.js#LL151C7-L151C18

and while the icon is loading for the first call to decorateIcons() , the second call to decorateIcons() does not evaluate https://github.com/adobe/helix-project-boilerplate/blob/main/scripts/lib-franklin.js#LL150C16-L150C16 but directly jumps to https://github.com/adobe/helix-project-boilerplate/blob/main/scripts/lib-franklin.js#L186.

bstopp commented 10 months ago

I think this is no longer an issue given the change icons are handled.