RocketChat / Rocket.Chat

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

[bug] stream-notify-room subscription #22970

Open alb-3 opened 3 years ago

alb-3 commented 3 years ago

reference : #22817

Description

Hi, I found a bug in the subscription to stream-notify-room in realtime api.

I followed the instruction to subscribe to typing (a event of stream-notify-room) but instead of receive ready answer I receive nosub.

I used ddp library that provides the unique subscription-id. The others parameters are in the format specified by the documentation ( https://developer.rocket.chat/api/realtime-api/subscriptions/stream-notify-room)

Steps to reproduce:

  1. creation of ddp client using ddp lib

  2. connection to server using ddp client

  3. login with ddp client using ddp-login lib

  4. register the guest (call to livechat:registerGuest)

  5. send the first message that creates the room (call to sendMessageLivechat)

  6. subscription: ddpClient.subscribe("stream-notify-room", [roomId+"/typing", false], () => { console.log("subscription"); } );

  7. listen to new message

Expected behavior:

receive { msg: 'ready', subs: [ 'a number' ] }

Actual behavior:

receive{ msg: 'nosub', id: 'a number' }

Server Setup Information:

yashovardhan commented 3 years ago

Hey there,

Thanks for reporting this.

I guess this is a duplicate of the other issue you mentioned. I'll close that issue in that case and get this checked as soon as possible.

steffenboe commented 2 years ago

any updates on this? i am facing basically the same issue (trying with python websockets), and with other streams as well.

cuongnn-smartosc commented 2 years ago

any updates, I have the same issue, it is intermittent

vinodchandel commented 1 year ago

I was also facing this issue in JS. but got typing notification by passing below object. You need to use 'user-activity' in place of 'typing' ( and hopefully for 'deleteMessage' as I didn't tried' deleteMessage' yet). I think they either forget to update or got some other issue. let streamNotifyObj = { msg:'sub', id:String(messagesCount++), name:'stream-notify-room', params:[ 'room-id/user-activity', ], };