Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Livechat room stream documentation incorrect and errors unreported

Open timkinnane opened this issue 7 years ago • 5 comments

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

timkinnane avatar Dec 13 '18 04:12 timkinnane

Thanks @timkinnane!

I'll take a look at this issue ASAP.

renatobecker-zz avatar Jan 30 '19 13:01 renatobecker-zz

Thanks @timkinnane It works

loymascarenhas avatar Jun 20 '19 13:06 loymascarenhas

@timkinnane thanks a lot, dude! It's worked after 3 days of unsuccessful attempts to receive messages.

@renatobecker 02/14/20 today xD

shaurgon avatar Feb 14 '20 15:02 shaurgon

Are the docs seriously not fixed after two years????

chris-aeviator avatar Aug 14 '20 15:08 chris-aeviator

i can not subscribe to room stream untill logged in and not getting messages in live chat stream subscription then how guest will get message

anandsoftinator avatar Jul 04 '24 10:07 anandsoftinator