RocketChat / RocketChat/Rocket.Chat
Already closed livechats re-appear sometimes
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
A livechat, which was closed some time ago, re-appears eventually in the sidebar list of one of our livechat agents. It is not quite reproducible, but comes up from time to time.
This time, I checked the database entry in rocketchat_room and compared it with another closed livechat, which doesn't appear. Here are the two:
The one which re-appeared:
{
"_id": "CJNtExhbzzK5moo96",
"msgs": 5,
"lm": ISODate("2018-12-10T07:27:47.238Z"),
"code": 84,
"label": "guest-38",
"t": "l",
"ts": ISODate("2018-05-29T11:30:12.192Z"),
"v": {
"_id": "aEMQAXECMz5jnGL37",
"username": "guest-38",
"token": "ReNqjRZ6nXbXkBpYR",
"status": "offline"
},
"cl": false,
"_updatedAt": ISODate("2018-12-10T07:27:47.430Z"),
"servedBy": {
"_id": "8gwG8RJ4HxWtH8ezi",
"username": "user-2"
},
"usersCount": 1,
"outOfSync": false,
"fname": "guest-38",
"closer": "user",
"closedBy": {
"_id": "gguwEdvBHAShkioMp",
"username": "user-3"
},
"closedAt": ISODate("2018-12-10T07:27:47.228Z"),
"responseBy": {
"_id": "gguwEdvBHAShkioMp",
"username": "user-3"
},
"metrics": {
"chatDuration": 16833455.036,
"response": {
"avg": 16833455.238,
"fd": ISODate("2018-12-10T07:27:47.430Z"),
"ft": 16833455.238,
"total": 1,
"tt": 16833455.238
},
"reaction": {
"fd": ISODate("2018-12-10T07:27:47.430Z"),
"ft": 16833455.238,
"tt": 16833455.238
}
}
}
Another one which works correctly:
{
"_id": "vQbGi6g2HQjCWkyqH",
"msgs": 6,
"lm": ISODate("2018-05-28T14:25:58.209Z"),
"code": 81,
"label": "guest-37",
"t": "l",
"ts": ISODate("2018-05-28T10:49:58.548Z"),
"v": {
"_id": "BfvNwpAGFHzvGbCZF",
"username": "guest-37",
"token": "g9gZbsRaTbp9Duz53",
"status": "offline"
},
"cl": false,
"_updatedAt": ISODate("2018-11-30T00:05:05.352Z"),
"servedBy": {
"_id": "7cWAheJrBgcP3ryn2",
"username": "user-1"
},
"usersCount": 1,
"outOfSync": false,
"fname": "guest-37",
"closer": "user",
"closedBy": {
"_id": "7cWAheJrBgcP3ryn2",
"username": "user-1"
},
"closedAt": ISODate("2018-05-28T14:25:58.197Z"),
"responseBy": {
"_id": "7cWAheJrBgcP3ryn2",
"username": "user-1"
},
"responseDate": ISODate("2018-05-28T10:50:36.733Z"),
"responseTime": 38.185,
"chatDuration": 12959.649
}
They seem to be very similar, but have different statistic / metric data, though this doesn't seem to be a good explanation. Also, there is a difference in the users who closed the room and the user who served it. In the first one, they are different, in the other one they are same. Don't know if this could help...
Server Setup Information:
- Version of Rocket.Chat Server: 0.71.1
- Operating System: Linux x64
- NodeJS Version: v8.9.4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the rocketchat_room records and the livechat sidebar behavior described in the issue, using the reported Rocket.Chat 0.71.1, NodeJS v8.9.4, and Linux setup as context. Compare closed rooms that reappear with those that do not; done means closed livechats no longer unexpectedly return to an agent's sidebar, with the intermittent case covered by a regression check if the relevant test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, node.js, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100