Skip to content

Conversation

@murtaza98
Copy link
Contributor

@murtaza98 murtaza98 commented May 14, 2021

Proposed changes (including videos or screenshots)

Issue(s)

Old Behaviour:
Currently when we forward a chat to a particular department and all the agents in target department are at maximum capacity, the chat either not getting transferred (on or after v3.13.0) or the user were getting an error saying no-agents are currently online(before v3.13.0).

New Behaviour:
In the new behaviour we're proposing, if a chat is forwarded and all agents in the target department are at maximum capacity, the chat will get transferred to the target department's waiting queue. This means that the chat will be removed from the current serving agent's chats and then will be moved to the target department's waiting queue. The visitor will see their current position within the queue.

Note: This feature will not affect the Manual Selection Omnichannel Routing method in any way.

Steps to test or reproduce

  1. Goto Admin -> Omnichannel -> Routing
    a. Set Omnichannel Routing Method to either Auto Selection or Load Balancing.
    b. Turn on Waiting Queue.
    c. Set Max. number of simultaneous chats to 1 (one)
  2. Create 2 departments, for and add one agents to each one of them respectively eg: TestDept-1 and TestDept-2 with Agent-1 and Agent-2 respectively.
  3. Start 2 Visitor conversation with each of the Department. After both the chats is started, forward the chat from one department to another. eg: Transfer from Agent-1 from TestDept-1 to TestDept-2.
  4. OLD BEHAVIOUR: If you're on version v3.13.0 or above, you should see that the chat is not transferred. If you're below v1.13.0, you should see an error message saying something like, no agents available.
  5. NEW BEHAVIOUR: The chat should be transferred to the target department's waiting queue and will be removed from the old department. In our example above: Agent-1 will be removed from TestDept-1 and will be put to Test-Dept-2. Its queue position will be 1. Once Agent-2 closes the existing chat, the forwarded chat should assigned to the Agent-2.

Further comments

@murtaza98 murtaza98 changed the title [EE] Fix Forwarding Department not working with Waiting queue feature [EE] Improve Forwarding Department behaviour with Waiting queue feature May 14, 2021
@murtaza98 murtaza98 requested a review from renatobecker May 14, 2021 16:47
Copy link
Contributor

@renatobecker renatobecker left a comment

Choose a reason for hiding this comment

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

Overall, your code looks good.
But I found an issue that is not solved yet: When an agent attempts to transfer a chat from department A to department B and there's no agent available on department B, the agent gets the message Trasnferred, but the chat hasn't been transferred.

@murtaza98
Copy link
Contributor Author

Overall, your code looks good.
But I found an issue that is not solved yet: When an agent attempts to transfer a chat from department A to department B and there's no agent available on department B, the agent gets the message Trasnferred, but the chat hasn't been transferred.

Hey @renatobecker, A new check I've added here should solve the above issue.

@murtaza98
Copy link
Contributor Author

@renatobecker I noticed that on the client we were not checking the transfer API response. As you are aware that transfer API aka (livechat:transfer method) returns a boolean specifying if the transfer was successful or not - however as you can see here, we weren't checking it due to which sometimes it was showing the Transferred success message even if the transfer was not successful.

To solve the above issue, I had to do some refactoring and you might now notice that within the handleOnAgentAssignmentFailed callback here, we're now returning the room object with a flag set incase we want this chat to be queued. Then within our forwardRoomToDepartment method we're checking this flag and putting the chat in queue if it's set. I think this is a better approach than my earlier solution as now we're reusing all these code.

Let me know what you think about this? Thx

@murtaza98 murtaza98 requested a review from renatobecker May 17, 2021 10:56
@renatobecker renatobecker merged commit 63248e1 into develop May 17, 2021
@renatobecker renatobecker deleted the ee-livechat-waiting-queue-fix branch May 17, 2021 23:08
@renatobecker renatobecker added this to the 3.14.1 milestone May 18, 2021
@sampaiodiego sampaiodiego restored the ee-livechat-waiting-queue-fix branch May 19, 2021 12:03
murtaza98 added a commit that referenced this pull request May 19, 2021
…re (#22043)

* [EE] Fix Forwarding Department not working with Waiting queue feature

* add waiting queue feature enabled check

* Refactor

* Fix forwarding of agents not working

* Apply suggestions from code review

Co-authored-by: Renato Becker <[email protected]>

* Handle transfer api response properly on client + refactor

* Avoid passing unnecessary params

* Remove throw error.

* Improve throw message logic.

* Fix on-hold queue. Methods have been removed in another PR.

* Remove all subscription from a chat placed on-hold.

Co-authored-by: Renato Becker <[email protected]>
murtaza98 added a commit that referenced this pull request May 19, 2021
…re (#22043)

* [EE] Fix Forwarding Department not working with Waiting queue feature

* add waiting queue feature enabled check

* Refactor

* Fix forwarding of agents not working

* Apply suggestions from code review

Co-authored-by: Renato Becker <[email protected]>

* Handle transfer api response properly on client + refactor

* Avoid passing unnecessary params

* Remove throw error.

* Improve throw message logic.

* Fix on-hold queue. Methods have been removed in another PR.

* Remove all subscription from a chat placed on-hold.

Co-authored-by: Renato Becker <[email protected]>
murtaza98 pushed a commit that referenced this pull request May 19, 2021
…re (#22043)

* [EE] Fix Forwarding Department not working with Waiting queue feature

* add waiting queue feature enabled check

* Refactor

* Fix forwarding of agents not working

* Apply suggestions from code review

Co-authored-by: Renato Becker <[email protected]>

* Handle transfer api response properly on client + refactor

* Avoid passing unnecessary params

* Remove throw error.

* Improve throw message logic.

* Fix on-hold queue. Methods have been removed in another PR.

* Remove all subscription from a chat placed on-hold.

Co-authored-by: Renato Becker <[email protected]>
renatobecker added a commit that referenced this pull request May 19, 2021
…ue feature (#22077)

* [EE] Fix Forwarding Department not working with Waiting queue feature

(cherry picked from commit 2b50040)

* add waiting queue feature enabled check

(cherry picked from commit d9fe3e3)

* Refactor

(cherry picked from commit 1b5c973)

* Fix forwarding of agents not working

(cherry picked from commit b4b3c3d)

* Apply suggestions from code review

Co-authored-by: Renato Becker <[email protected]>
(cherry picked from commit 0c6f7ec)

* Handle transfer api response properly on client + refactor

(cherry picked from commit d750c59)

* Avoid passing unnecessary params

(cherry picked from commit 53eec95)

* Remove throw error.

(cherry picked from commit deccab9)

* Improve throw message logic.

(cherry picked from commit 85b015d)

* Fix conflicts

* Remove all subscription from a chat placed on-hold.

(cherry picked from commit d49c8fe)

* up fuselage version

* add string-helpers package

* [EE] Improve Forwarding Department behaviour with Waiting queue feature (#22043)

* [EE] Fix Forwarding Department not working with Waiting queue feature

* add waiting queue feature enabled check

* Refactor

* Fix forwarding of agents not working

* Apply suggestions from code review

Co-authored-by: Renato Becker <[email protected]>

* Handle transfer api response properly on client + refactor

* Avoid passing unnecessary params

* Remove throw error.

* Improve throw message logic.

* Fix on-hold queue. Methods have been removed in another PR.

* Remove all subscription from a chat placed on-hold.

Co-authored-by: Renato Becker <[email protected]>

Co-authored-by: Renato Becker <[email protected]>
Co-authored-by: Tiago Evangelista Pinto <[email protected]>
@sampaiodiego sampaiodiego mentioned this pull request May 19, 2021
@sampaiodiego sampaiodiego deleted the ee-livechat-waiting-queue-fix branch May 28, 2021 01:40
@sampaiodiego sampaiodiego mentioned this pull request May 28, 2021
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.

3 participants