I am using the lazy loading deployment of the Genesys Widgets. When restoring an open chat window on site reload, I run into a race condition, as the webchatservice
wants to load the webchatservicelegacy
module before the corresponding plugin is actually loaded.
I have been using the main.preload
hook my widgets.config
to load the module but from what I can grasp from the minified code it does not guarantee that the modules are loaded before execution continues, setTimeout without a Promise or any other callback.
Loading the legacy module right after the widgets-core
plugin reduces the problem somewhat but does not fix it, especially on slower connections.
Is there a way to mitigate this?
Modifying the webchatservice
to actually load the plugin and afterwards load the module seems to work.