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

bug in CallbackRegistry#remove #38

Closed
intale opened this issue Apr 23, 2013 · 2 comments
Closed

bug in CallbackRegistry#remove #38

intale opened this issue Apr 23, 2013 · 2 comments

Comments

@intale
Copy link
Contributor

intale commented Apr 23, 2013

https://github.com/pusher/pusher-js/blob/master/src/events_dispatcher.js#L67
If index is -1, last callback function will be deleted. So, in this case, if I did, e.g.:
channel.bind("user-updated", func1)
and then
channel.unbind("user-updated", someAnotherFunc)
it will delete func1 callback, which is wrong.

@pl
Copy link
Contributor

pl commented Apr 24, 2013

Thanks for catching this! I added a test case for this bug and adjusted the code to our standards. Your fix will be released in 2.0.3, most probably today.

@intale
Copy link
Contributor Author

intale commented Apr 24, 2013

Thanks!

@intale intale closed this as completed Apr 24, 2013
pl added a commit that referenced this issue Apr 24, 2013
pl pushed a commit that referenced this issue Apr 24, 2013
ecarter pushed a commit to ecarter/pusher-js that referenced this issue Mar 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants