RocketChat / RocketChat/Rocket.Chat

Livechat.transfer should be transactional

Open
#6,198 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

subj: livechat type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

I'm running multiple instances of Rocketchat and noticed unique index errors when livechat is assigned to other agents. I think Verloop.Livechat.forwardOpenChats should be done using some kind of transaction technique so that multiple instance do not try to forward same room. One approach I can think of is to use some state for the room and then use findAndUpdate.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Verloop.Livechat.forwardOpenChats and trace its findAndUpdate path, then inspect how concurrent Rocket.Chat instances assign the same room. Reproduce the multi-instance case if the project has a relevant test harness; done means concurrent forwarding no longer produces duplicate assignments or unique-index errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, databases, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.