adobe / aem-spa-page-model-manager

Interface between Adobe Experience Manager and Single Page Application framework.
Apache License 2.0
33 stars 24 forks source link

Inconsistent Attachment of AEM Data to Multiple Microfrontends Loaded via SingleSpa #102

Open cbracewell opened 1 year ago

cbracewell commented 1 year ago

Describe the bug

I'm loading multiple microfrontends using SingleSpa. Each microfrontend initializes its own instance of ModelManager using the following code:

ModelManager.initializeAsync({
    path: 'path',
    modelClient: new ModelClient('url'),
})

The issue is that when the page is loaded, the AEM data is correctly attached to one microfrontend but not to the others. This behavior seems to occur randomly and is associated with the last microfrontend that was loaded.

Package version 1.5.0

To Reproduce Page initial load

Expected behavior To see the AEM data correctly attached to each microfrontend

Screenshots N/A

Additional context I'm assuming the model is being overwritten by the most recent ModelManager.initializeAsync call