RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.07k stars 10.34k forks source link

livechat/agent.next/ not giving next agent in line #22948

Open mfahad19 opened 3 years ago

mfahad19 commented 3 years ago

Hi the /api/v1/livechat/agent.next/:token is just giving success=true and nothing else. I believe due to this /api/v1/livechat/room creates a room and doesn't assign a agent to it.

Reference to documentation: https://developer.rocket.chat/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-agent/next-agent

This has caused one of our systems that sends chats to the rocket chat system to fail.

Version 3.17.0 (snap) Apps Engine Version 1.27.1 Node Version v12.22.1 Database Migration 228 (August 17, 2021 3:17 PM) MongoDB 3.6.14 / wiredTiger (oplog Enabled)

yashovardhan commented 3 years ago

Hey there,

Thanks for reporting this.

Can you help us by telling the steps to replicate this issue? We will get this checked accordingly.

mfahad19 commented 3 years ago

When calling agent.next api (we use postman to call this for testing) api/v1/livechat/agent.next/iNKE8aTOKENhWdeee GET

Response : 
{
    "success": true
}

The actual response should be like (as mentioned in the docs https://developer.rocket.chat/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-agent/next-agent):

{
  "agent": {
    "_id": "7Gm3AISDAJ3r6sJ68XR",
    "emails": [
      {
        "address": "agent@rocket.chat",
        "verified": true
      }
    ],
    "name": "Livechat Agent",
    "username": "livechat.agent"
  },
  "success": true
}