sendMessage doesn't send messages sometimes to the agent

I am using https://developers.livechatinc.com/blog/livechat-visitor-sdk/
for custom integration of livachat. But sometimes, it does not send messages to the agent and doesn’t show any error message too.
It is happening frequently. Please suggest the solution for license ID : 10882487.

Thanks in advance.

Hi
Can you tell me how do you generate ‘customId’ for the messages?

1 Like

Hi Michal_P, we are using String(Math.random()) for generating customId

Thank you, we will investigate this and get back to you as soon as we will know something more.

Hi @n.sharma

I’ve reviewed your implementation and found the source of the problem.
In chat_starded callback there is hidePrechat function with prechatForm.classList.add("hide"); call. prechatForm was undefined and it led to error. Prepending

if (!prechatForm) {
    return;
  }

in hidePrechat function will fix the issue.

On the other hand, error in callback handler shouldn’t lead to VisitorSDK breakdown and this is something we should fix.

Let me know if my answer has fixed your problem.

1 Like

Hey,

Tried with the same and worked when the other unused functions like hideRateChat, hideQueueMessage, showQueueMessage etc. also handled with the same condition. Now looks working.

Now need to check for delay in sending messages.

Thanks a lot !! :slight_smile:

1 Like

Hi ,

I am still facing the same problem frequently.
And one more issue I have observed is sometimes the greeting message is appearing, sometimes the welcome message is appearing and sometimes none of them is being shown. In that case the messages are not getting delivered.

Also the delay time is more. Please help us what we are doing wrong.

Thanks in advance

Hi @n.sharma,

I passed your case to our devs, and they will investigate this problem.

Hi Daria,

Is there any progress on the above thread ? Please let us know about the problem as its being critical now and we are not able to go live.

Hi @n.sharma

Sorry for this delay but the case came out to be a bit complicated. Our developers are still working on it. I promise to give you a detailed answer by Monday.

I really appreciate your patience.

Hi @n.sharma,

The case came out to be more complicated, and our developers are still working on it. I will inform you as soon as they get the answer.