Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PubSub listeners can't be removed #198

Closed
bartje321 opened this issue Dec 9, 2020 · 1 comment
Closed

PubSub listeners can't be removed #198

bartje321 opened this issue Dec 9, 2020 · 1 comment
Labels

Comments

@bartje321
Copy link

bartje321 commented Dec 9, 2020

Bug Report

When registering PubSub listeners the topicName is generated using the type, userId and additional parameters. This is used as key in the listeners map. When removing the listener it looks up the map only on type, which won't exists because it's missing the userId and the additional parameters.

Code

https://github.com/d-fischer/twitch/blob/45175a0d4e0ff9bc17410419a03abae179b84487/packages/twitch-pubsub-client/src/SingleUserPubSubClient.ts#L255

https://github.com/d-fischer/twitch/blob/45175a0d4e0ff9bc17410419a03abae179b84487/packages/twitch-pubsub-client/src/SingleUserPubSubClient.ts#L191

Expected behavior

listener gets removed on calling .remove();

Actual Behavior

Listener doesn't get removed and PubSub client won't disconnect.

Environment

  • Version: 4.3.5
  • Node version: v14.10.0
  • Operating system: MacOsx
@d-fischer
Copy link
Member

Thanks for reporting and even doing some research! I published version 4.3.6 which should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants