Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Livechat triggers not firing #15897

Merged
merged 2 commits into from Dec 4, 2019

Conversation

renatobecker-zz
Copy link

@renatobecker-zz renatobecker-zz commented Dec 2, 2019

CLOSES #15842

The Livechat.getNextAgent method returns a promise, but there was a promise handler missing when calling this method inside the livechat/agent.next endpoint, then the expected value wasn't being returned.

@renatobecker-zz renatobecker-zz added this to the 3.0.0 milestone Dec 2, 2019
@renatobecker-zz renatobecker-zz added this to In progress in Omnichannel Roadmap via automation Dec 2, 2019
@renatobecker-zz renatobecker-zz modified the milestones: 3.0.0, 2.3.1 Dec 2, 2019
Omnichannel Roadmap automation moved this from In progress to Needs review Dec 3, 2019
Copy link
Member

@sampaiodiego sampaiodiego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is another place calling it without waiting for the promise to resolve:

const agent = Livechat.getNextAgent(department);

@renatobecker-zz
Copy link
Author

there is another place calling it without waiting for the promise to resolve:

const agent = Livechat.getNextAgent(department);

@sampaiodiego, I just pushed the requested change. I didn't implement it before because we're not using/calling that method(Meteor) anymore, but yeah, there is a chance that someone is using it externally, so I just fixed it.

Thanks.

Omnichannel Roadmap automation moved this from Needs review to Reviewer approved Dec 4, 2019
@sampaiodiego sampaiodiego changed the title [FIX] Promise handler missing when calling the agent.next endpoint [FIX] Livechat triggers not firing Dec 4, 2019
@sampaiodiego sampaiodiego merged commit 0ff02cf into develop Dec 4, 2019
Omnichannel Roadmap automation moved this from Reviewer approved to Done Dec 4, 2019
@sampaiodiego sampaiodiego deleted the fix-omnichannel-next-agent-endpoint branch December 4, 2019 20:17
@franckadil
Copy link

Thanks guys for fixing this annoying bug ! 👍

@sampaiodiego sampaiodiego mentioned this pull request Dec 9, 2019
@CH1PSET1
Copy link

Hello, after updating to 2.3.1, triggers still do not work. The trigger turns on and the live chat disappears. Until 2.3.0 it was normal.

@renatobecker-zz
Copy link
Author

Hello, after updating to 2.3.1, triggers still do not work. The trigger turns on and the live chat disappears. Until 2.3.0 it was normal.

Hi @CH1PSET1! Can you please check your browser console? If you get any error there, can you please share it here?

Thanks.

@CH1PSET1
Copy link

image
You can go to the site www.tunc72.ru, the trigger for opening the chat should fire when the site is opened.

@renatobecker-zz
Copy link
Author

renatobecker-zz commented Dec 12, 2019

image
You can go to the site www.tunc72.ru, the trigger for opening the chat should fire when the site is opened.

Hi @CH1PSET1, I know what it's happening.
This is a bug on the widget, which has its own repo, as you can see here.
The fact is this issue has already been fixed, but we need to release a new version of the widget and then release a new version of the Rocket.Chat, supporting the new Livechat widget version.

I'm going to raise this discussion internally to define the best alternative to get this fix out ASAP.
Thanks.

@renatobecker-zz
Copy link
Author

@CH1PSET1, the issue has been fixed.
We released the 2.3.2 version yesterday, which provides the new widget version.

Thanks.

@CH1PSET1
Copy link

Hello. Updated to 2.3.2, the situation has not changed ..

image

@franckadil
Copy link

Hi @CH1PSET1 and @renatobecker ,

I have been able to test 2.3.2 on 2 installations and I can confirm the error have been fixed.

Hash ffb478f
Date Thu Dec 12 18:15:05 2019 -0300
Branch HEAD
Tag 2.3.2
Author Diego Sampaio
Subject Merge pull request #15967 from RocketChat/release-2.3.2

I have checked your website, and I don't see the Triggers error in your logs, the console displays an other set of errors related to c.map not finding a correct Google Map API key https://chat.cnp72.ru/livechat/components.chunk.8b9f8.js.

I would suggest the following steps:

  • Make sure to disable Google Status Map and Check again.
  • Make sure that you are using the right Google API Key. Documentation Status Map

Regards

@CH1PSET1
Copy link

In fact, I also do not understand what is happening. Earlier, before switching to version 2.3.0 when entering the site, a trigger worked and a live chat opened. Now, I'm on version 2.3.2, when I enter the site, the trigger seems to work, but the chat becomes transparent and does not appear (as in the screenshot above). Because of what this situation is, I do not know and cannot find a solution. If you do not use triggers, then the chat is working fine. I don’t quite understand how to disable the Google Status Map, can you tell me? Thanks.

@franckadil
Copy link

franckadil commented Dec 16, 2019

Hi,

Sure, first thing first head to the Administration:

1- Search for Maps

image

2 - Then click on Message:

image

3- Click on Google Maps

image

4- Last step, deactivate Google Maps:

image

Please let us know if that solves your problem.

Otherwise, can you provide more information about your Setup ?

  • Installation type, Docker, Snap or Manual ?
  • Do you use Cloudflare or any other Cache proxy ?
  • Do you use a CDN ?

Kind regards,

@CH1PSET1
Copy link

My Google maps were already turned off, so the situation has not changed ..

For questions:

  1. Installation Type - Manual
  2. No
  3. None.

@franckadil
Copy link

Hi @CH1PSET1 ,

I have checked your livechat and I don't see the errors anymore. So I guess that it's because you have deactivated the triggers.

image

I have also run some tests on the components.chunk and the file is free from any error.

So let's proceed differently this time:

But before :) have you followed all the steps highlighted here for the Manual update ? https://rocket.chat/docs/installation/updating/

  1. What type of trigger do you use ? (can you provide a screenshot ?).
  2. Can you recreate the trigger (delete and create a new one).
  3. Make sure in the Admin > Message area that Google API is disabled too.
  4. Please can you purge your Nginx Cache or any cache on the server
    image

All you JS files assets are cached 304.

Regards,

@CH1PSET1
Copy link

1.1. Previously, the trigger worked, as soon as the user navigated to the site www.tunc72.ru, a live chat opened and asked how it could be helped, then the user answered in a chat and accepted the question the first free operator.

I’ll clarify, another trigger is on the site www.centrnp72.ru, where it fires after 20 seconds of conducting on the site. You can see that the first 20 seconds the live chat works, and then, as the trigger works, it disappears.

image

  1. Yes, I already performed this operation.

  2. Also not activated

  3. It did

@CH1PSET1
Copy link

image
This is how a live chat and trigger behaves after 20 seconds of waiting.

@renatobecker-zz
Copy link
Author

renatobecker-zz commented Dec 18, 2019

Guys, the error is on the widget, so it would be better to create a new issue on the correct Livechat Widget repo.
Anyway, the map is not a function error doesn't have any relation with the Google Map feature, it's the Array map function, which is being called from a null or empty value.
Here is the part of the code related to this error.

So, the reason for this error is pretty simple, your trigger uses a Custom agent to send the message, but you didn't provide any custom name, due to that the Livechat widget is broken.
To fix this you just need to provide a Custom agent name, as displayed below:

Screen Shot 2019-12-18 at 18 42 58

As I just explained, this is a bug on the Livechat widget, so please, open a new issue on the right repository describing your case, then we'll be able to check and fix it.

Thanks.

@franckadil
Copy link

@renatobecker You saved the day sir ! Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Livechat Triggers don't work
6 participants