Skip to content

Conversation

@AlexanderKanakis
Copy link
Collaborator

@ear-dev
Copy link

ear-dev commented Sep 19, 2022

@AlexanderKanakis I tested this and it looks good.
@csmith14 can you review please? thanks...

Copy link
Collaborator

@csmith14 csmith14 left a comment

Choose a reason for hiding this comment

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

Tested and looks good to me!

Copy link
Collaborator

@Shailesh351 Shailesh351 left a comment

Choose a reason for hiding this comment

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

I just found that Closed by agent will be used also for other reasons for chat being closed. i.e. Session expiration, or any other App/network error.

Closed by agent should be set only when the chat is actually ended by the salesforce agent. which is when we receive ChatEnded with reason agent from salesforce
https://github.com/WideChat/Apps.Salesforce.LiveAgent/blob/master/helperFunctions/subscribeHelpers/SalesforceAgentAssignedHelpers/SubscribeToLiveAgentHelper.ts#L64...L73

We should keep other message for other errors

@ear-dev
Copy link

ear-dev commented Sep 22, 2022

Thanks @Shailesh351 If I understand this correctly, we are currently catching a few network errors like, 403, 204, an 409, but anything else gets caught in closed by agent. So the fix is to specifically check for the SF flag "reason==agent" in another 'else if' statement. Is that your suggestion?

@Shailesh351
Copy link
Collaborator

Thanks @Shailesh351 If I understand this correctly, we are currently catching a few network errors like, 403, 204, an 409, but anything else gets caught in closed by agent. So the fix is to specifically check for the SF flag "reason==agent" in another 'else if' statement. Is that your suggestion?

Yes...

@AlexanderKanakis
Copy link
Collaborator Author

@Shailesh351 A small clarification: We need events for the rest of the statues codes?

@Shailesh351
Copy link
Collaborator

@AlexanderKanakis Not exactly error codes, It should set message for whatever reason it was closed. If it was closed by some error it should show that error.

Copy link
Collaborator

@Shailesh351 Shailesh351 left a comment

Choose a reason for hiding this comment

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

@ear-dev FYI this PR adds new Chat closed events that were not covered earlier.

Copy link
Collaborator

@Shailesh351 Shailesh351 left a comment

Choose a reason for hiding this comment

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

There are places when the session expired but the event is missing. handlers/LiveAgentSessionHandler.ts helperFunctions/subscribeHelpers/InitiateSalesforceSessionHelpers/CheckChatStatusHelper.ts

Same for UNKNOWN_ERROR_IN_CHECKING_AGENT_RESPONSE, you can global search for UNKNOWN_ERROR_IN_CHECKING_AGENT_RESPONSE
in helperFunctions/subscribeHelpers/InitiateSalesforceSessionHelpers/CheckChatStatusHelper.ts handlers/InitiateSalesforceSessionHandler.ts

@ear-dev
Copy link

ear-dev commented Oct 6, 2022

@Shailesh351 after Alexander merges the 78 changes into this PR please have another look. thanks.

@AlexanderKanakis
Copy link
Collaborator Author

Merged #78 to #75 . Ready to review.

Removed redundant code

Better pies for Shailesh
@Shailesh351
Copy link
Collaborator

Shailesh351 commented Oct 11, 2022

@ear-dev I have added the new events in the wiki which are included in this PR https://github.com/WideChat/Rocket.Chat/wiki/SNS-Logger/_compare/1eee89aad850ee3957c4365c51ec687f61f41002

@ear-dev
Copy link

ear-dev commented Oct 11, 2022

@ear-dev I have added the new events in the wiki which are included in this PR https://github.com/WideChat/Rocket.Chat/wiki/SNS-Logger/_compare/1eee89aad850ee3957c4365c51ec687f61f41002

That's awesome! Thanks @Shailesh351

Copy link
Collaborator

@Shailesh351 Shailesh351 left a comment

Choose a reason for hiding this comment

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

Thanks, Alexander!

@ear-dev
Copy link

ear-dev commented Oct 13, 2022

@AlexanderKanakis I tested a case where the Salesforce agent went offline mid chat, and the 'Conversation Closed' system message is not correct. It is showing the contents of the sf.app config entry for "No Live Agent Available Message *"

Can you take a look please? thanks...

image

@ear-dev
Copy link

ear-dev commented Oct 13, 2022

@AlexanderKanakis I tested a case where I mangled the SF url in the admin UI. What happened is that I get the proper Conversation Closed message, but that same message is also now sent to the visitor in the chat window, instead of the expected "Technical Difficulty Message *" as configured in the SF admin UI.

Can you take a look please? thanks.

image

@AlexanderKanakis
Copy link
Collaborator Author

@AlexanderKanakis I tested a case where I mangled the SF url in the admin UI. What happened is that I get the proper Conversation Closed message, but that same message is also now sent to the visitor in the chat window, instead of the expected "Technical Difficulty Message *" as configured in the SF admin UI.

Can you take a look please? thanks.

image

@ear-dev do you happen to have debug messages activated?

@ear-dev
Copy link

ear-dev commented Oct 13, 2022

@AlexanderKanakis making a note here of what we just discussed....

It seems to me like you may have some wires crossed. Please go back over the entire PR and distinguish properly between messages sent to the visitor and messages that are only meant to show up as system messages for the admin under "conversation closed".

The messages meant for the visitor are most often configured in the app.admin.ui

Thanks.

-Specify client end messages not caused by error
@AlexanderKanakis
Copy link
Collaborator Author

The issue was caused by our error callback function. The error description was used both for the admin UI close message and the client message.

Additionally, when the chat was ended by non-error reasons, the client did not get a specific technical issues, or no agents available, message before the end chat message. Both are fixed with new commit.

@ear-dev
Copy link

ear-dev commented Oct 13, 2022

thanks @AlexanderKanakis this is now working as expected.

@ear-dev ear-dev merged commit f4f58e6 into master Oct 13, 2022
@AlexanderKanakis
Copy link
Collaborator Author

200

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] [Chat End Logging] Fix "Conversation closed:" logging as seen in a chat session transcript for escalated sessions

4 participants