pubnub / js-chat

PubNub JavaScript Chat SDK
https://github.com/pubnub/js-chat
8 stars 6 forks source link

Bug: Disconnecting typing does not appear to work #178

Open WalrusSoup opened 1 month ago

WalrusSoup commented 1 month ago

Disconnecting from typing listeners via the function returned from getTyping does not appear to work. The old CB will still receive events.

// Stop watching the old channel
if (this.currentChannelStopTypingUpdatesDisconnectFunction) {
    console.log('disconnecting existing handler')
    this.currentChannelStopTypingUpdatesDisconnectFunction();
}
// Watch only the new channel
this.currentChannelStopTypingUpdatesDisconnectFunction = channel.getTyping((typing) => {
    console.log('got typing events');
});

To reproduce:

  1. Join the same channel
  2. Have the user start typing
  3. Call disconnect
  4. Callback still keeps firing
piotr-suwala commented 1 month ago

Hello!

We've put your item in the backlog and we'll take care of this in near future :)