Our server is server-rendering so during loading the Messenger component is not yet loaded.
Now, the problem is when there is a existing conversation and the page is loaded, the component is not yet loaded and ready to receive the Messaging events. In this case, our Bot will be unuseable.
I tried refetching the old message using the following wherein if the startConversation is rejected, we will call the fetchHistory. But in this case, MessagingService.historyComplete is triggered with no data in it and MessagingService.oldMessages is not triggered.
Genesys(
'command',
'MessagingService.startConversation',
data,
() => {},
() => { // call MessagingService.fetchHistory here },
);
Is this by specification or a bug? If it is a specification, isn't it better if there is always an endpoint to get the old messages?