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

Lines can be sent out-of-order #361

Open
edfletcher opened this issue Jun 17, 2023 · 2 comments · May be fixed by #362
Open

Lines can be sent out-of-order #361

edfletcher opened this issue Jun 17, 2023 · 2 comments · May be fixed by #362

Comments

@edfletcher
Copy link

edfletcher commented Jun 17, 2023

I initially filed this as an issue against my client, which uses this framework. At the time of filing that issue I'd encountered the bug multiple times, but only ever saw it reproduce when a very long input line was broken up before being sent. As I note in that issue description, I suspected it might be in this framework because I don't recall ever writing the code to break lines apart.

Upon further investigation I found that I do not break those lines apart (here & here are the call sites for IRC.Client functions that send messages, directly passing along the full message line).

That led me to dig into the IRC.Client code, and there I found clearly where the line break-up is taking place.

Digging in further I then came upon the eventual Connection.writeLine() function tasked with actually emitting lines onto the connected socket. This method calls the underlying net.Socket.write() method without checking the return value nor passing in a functional callback for notification of when the data has actually been written. Indeed, this would explain the behavior I saw.

@edfletcher
Copy link
Author

I was able to create a test that can reproduce the issue and have a proposed fix for it behind a new serialize_writes option. I'll get that cleaned up and submitted as a PR here soon.

@edfletcher
Copy link
Author

PR submitted: #362

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