RocketChat / RocketChat/Rocket.Chat

Livechat room stream documentation incorrect and errors unreported

Open
#12,939 5 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Rocket.Chat v0.71.1

I found the docs and codebase are out of sync regarding expected arguments for subscribing to a livechat room stream via DDP.

Also, it doesn't throw an error to catch or debug the subscription attempt, seems to just silently return false.

See docs.

Code:

https://github.com/RocketChat/Rocket.Chat/blob/e6d9375fe28abf907577a1e66220d23b6d2027c1/packages/rocketchat-livechat/server/lib/Livechat.js#L877-L889

What's expected seems to be:

"ROOM_ID",
{
  "args":[{ "visitorToken":"TOKEN" }]
}

The documentation shows a token argument instead of visitorToken - I think that's what's usually required and seems to even be used for livechat notification streams, just not messages. It should be consistent, no? Also it's unclear if the documented useCollection attribute does anything.

Still, after resolving the proper attributes for the subscription, there seems to be no events emitted on the stream when messages are sent to the room. I was able to get the messages from a regular stream-room-messages though. Does this stream only emit events like agent assignment? That should also be cleared up in the docs.

Ping @renatobecker

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

Review the linked streamlivechatroom documentation alongside packages/rocketchat-livechat/server/lib/Livechat.js#L877-L889. Compare the documented token, visitorToken, useCollection, and event behavior with stream-room-messages and livechat notification streams. Done means the accepted arguments, errors, and emitted events are accurately explained in the documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.