Skip to content

Conversation

gbhardwaj00
Copy link
Contributor

Summary

This PR fixes the order of method calls in the useChatRoom example. Previously, connection.connect() was called before connection.on('message', ...), which caused a subtle issue: the message handler (messageCallback) might be null when the first message interval ticks.

What Changed

  • Moved connection.on('message', ...) before connection.connect() in the example code.

@rickhanlonii
Copy link
Member

That bug isn't possible because the listener is registered before yielding to the event loop.

Going to close because it's not worth the translation churn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants