Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@silverbucket
Copy link
Member

@silverbucket silverbucket commented Aug 16, 2021

Allows for multiple handlers to be registered for the special on events that sockethub-client needs to intercept. Resolves #495

@silverbucket silverbucket added bug kredits-1 Small contribution labels Aug 16, 2021
@silverbucket silverbucket added this to the Core milestone Aug 16, 2021
@silverbucket silverbucket requested a review from raucao August 16, 2021 20:12
@silverbucket silverbucket self-assigned this Aug 16, 2021
Copy link
Contributor

@raucao raucao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! 👏

Just a syntax nitpick for now (which your text editor should actually warn about, if it's linting the source code live). Have yet to test it with running code.

@silverbucket
Copy link
Member Author

I've done some manual testing, but not extensively. I don't have any unit tests set up for this JS file, but plan to add integration tests which would register multiple handlers, etc. (Once that branch work is complete). Created issue: #525

@silverbucket silverbucket requested a review from raucao August 17, 2021 09:35
@raucao
Copy link
Contributor

raucao commented Aug 17, 2021

Just one question, as I was looking at it: did you consider removeListener() / off() to work with this? Because that's actually what we need in Hyperchannel, too.

@silverbucket
Copy link
Member Author

@raucao that's not implemented, I'm thinking maybe this would be better to include an actual event emitter which proxies for the socket even emitter, rather than a makeshift one. It would need to basically be re-written though. Maybe this could be a temporary fix for the specific issue with a new task to re-write the whole thing?

Copy link
Contributor

@raucao raucao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's do it as you propose. I was able to test this one with Hyperchannel successfully (albeit the channel join failures directly after the connect still persist, so that's a different issue in the XMPP platform itself).

@silverbucket
Copy link
Member Author

Created #526

@silverbucket silverbucket merged commit 3fc5585 into master Aug 18, 2021
@silverbucket silverbucket deleted the sockethub-client-listeners branch August 18, 2021 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kredits-1 Small contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sockethub-client overwriting socket.on with a version that doesn't support multiple listeners

3 participants